Announcement Announcement Module
No announcement yet.
RFC: Enhanced MockWebServiceServer for spring-integration outbound gateway tests Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • RFC: Enhanced MockWebServiceServer for spring-integration outbound gateway tests

    As mentioned in and there's a need for integration testing of outbound gateways.

    You already have the possibility of using the MockWebServiceSender of spring-ws-test to mock your WebServiceMessageSender or WebServiceConnection. As we're using spring-integration by xml configuration, we don't have any WebServiceTemplate or WebServiceGatewaySupport declared. But we have the chance to set an individual MessageSender which will be used by the outbound-gateway:
    <bean id="messageSenderMock" class=""/>
    <si-ws:outbound-gateway id="externalServiceGateway"
    Now we want to write a test, showing that the configured gateway listens on requests and gives us valid responses. Since we don't want our tests to be dependent on external services, we need our gateway to create a well known response, depending on our request. This is already supported by the mentioned MockWebServiceMessageSender.

    Sadly, two classes (MockWebServiceMessageSender and MockWebServiceServer) would need some changes to enable us using them in our scenario. I'll attach an example ( which shows our way of testing the above gateway, including the mentioned spring-ws-test classes with our enhancements.

    Would you like to check our changes to the mock classes and give me some feedback whether our approach is valid? I would also like to contribute a patch with the needed changes (see the attached file [spring-ws-test] How would I have to contribute a patch so that it would be included in a future release? The patch is based on the current spring-ws release 2.0.4.