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

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

    As mentioned in http://forum.springsource.org/showth...DrivenConsumer and http://forum.springsource.org/showth...iance-question 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:
    Code:
    <bean id="messageSenderMock" class="org.springframework.ws.test.client.MockWebServiceMessageSender"/>
    <si-ws:outbound-gateway id="externalServiceGateway"
                                uri="https://www.example.com/path/method.asmx"
                                message-sender="messageSenderMock"/>
    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 (spring-integration_gateway_test.zip) which shows our way of testing the above gateway, including the mentioned spring-ws-test classes with our enhancements.

    Question:
    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]_mock_patches.zip). 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.
Working...
X