private QName _serviceName = new QName("urn:test", "Service");
private ServiceInterface _metadata = new InOnlyService(OPERATION_NAME);
@Test
public void messageComposerComposeTest() {
MockHandler mock = new MockHandler().forwardInToOut();
_serviceDomain.registerService(_serviceName, _metadata, mock);
_serviceDomain.registerServiceReference(_serviceName, _metadata);
InboundHandler<?> handler = createInboundHandler(_serviceName, "direct:input", "input",
new V1MessageComposerModel(SwitchYardNamespace.DEFAULT.uri()).setClazz(Composer.class.getName()));
handler.start();
sendBody("direct:input", PAYLOAD);
mock.waitForOKMessage();
List<Exchange> exchanges = new ArrayList<Exchange>();
mock.getMessages().drainTo(exchanges);
assertEquals(1, exchanges.size());
assertEquals(Composer.COMPOSE_PREFIX + PAYLOAD, exchanges.get(0).getMessage().getContent());
handler.stop();
}