bindingModel = mock(CamelBindingModel.class);
when(bindingModel.getComponentURI()).thenReturn(URI.create("transaction:foo?transactionManager=%23jtaTransactionManager"));
when(bindingModel.getReference()).thenReturn(referenceModel);
_messageComposer = CamelComposition.getMessageComposer();
_serviceDomain.registerService(_targetService.getServiceName(),
new InOnlyService(),
new OutboundHandler(bindingModel,
(SwitchYardCamelContext) context, _messageComposer, null
) {
{
setState(State.STARTED);
}
}
);
_service = _serviceDomain.registerServiceReference(
_targetService.getServiceName(), new InOnlyService());
Exchange exchange = _service.createExchange();
MockEndpoint endpoint = getMockEndpoint("mock:result");
endpoint.expectedBodiesReceived("foo");
exchange.send(exchange.createMessage().setContent("foo"));