}
private org.switchyard.Exchange createMockExchangeWithBody(MessageCreator creator) {
final org.switchyard.Exchange switchYardExchange = mock(org.switchyard.Exchange.class);
final org.switchyard.Context switchYardContext = mock(org.switchyard.Context.class);
final ExchangeContract exchangeContract = mock(ExchangeContract.class);
final ServiceOperation serviceOperation = mock(ServiceOperation.class);
final ServiceOperation referenceOperation = mock(ServiceOperation.class);
final Service provider = mock(Service.class);
final Message message = creator.create();
when(switchYardExchange.getMessage()).thenReturn(message);
when(provider.getName()).thenReturn(SERVICE_QNAME);
when(switchYardExchange.getProvider()).thenReturn(provider);
when(switchYardExchange.getContext()).thenReturn(switchYardContext);
when(referenceOperation.getOutputType()).thenReturn(JAVA_STRING_QNAME);
when(exchangeContract.getProviderOperation()).thenReturn(serviceOperation);
when(serviceOperation.getInputType()).thenReturn(JAVA_STRING_QNAME);
when(serviceOperation.getOutputType()).thenReturn(null);
when(serviceOperation.getFaultType()).thenReturn(null);
when(exchangeContract.getConsumerOperation()).thenReturn(referenceOperation);
when(switchYardExchange.getContract()).thenReturn(exchangeContract);
return switchYardExchange;
}