glTranter
14 years agoNew Contributor
maven-soapui-plugin not routing mock request correctly
System details
Java 1.6
Ubuntu 10.04
Maven 3
maven-soapui-plugin 4.0.1
Given a maven project with two nested multi module projects.
Each of the nested projects contains a webservice project. Service1 depends upon the Services of Service2, and both Service1 and Service2 depend on ExtService.
Each nested webservice project has its own set of integration tests which make use of maven-soapui-plugin to mock out ExtService, and Service1 has additional mocking for Service2.
Service1 depends on methodX from ExtService while Service2 has no such dependency, so the mocks configured for Service1 have ExtService.methodX while the mocks for Service2 do not.
When mvn clean install is ran for each individual nested project all tests pass as expected and build.
However when we run mvn clean install on the parent project we see test failures in Service1 (note due to the fact that Service1 depends on Service2 it is the second project to be built).
We see an error stating that we have a missing service.
Given that the mock service are now operating on different ports by the time the int tests for Service1 are being run we have two instance of maven-soapui-plugin running, each with a mock for ExtService but running on a different port. However we still get the a missing operation error during Service1 build phase.
When we add the missing service to Service2's ExtService mock the build proceeds to completion without any errors, this indicates that requests to the mocks are not being routed based upon the host and port of the request but via some other mechanism which favours the first created instance of maven-soapui-plugin or teh first created instance of a mock rather than the correct instance.
The easy fix would be to provide a shutdown goal that can be mapped to a lifecycle phase or to ensure that maven-soapui-plugin shutdown correctly at the end of a multi module lifecycle phase.
Java 1.6
Ubuntu 10.04
Maven 3
maven-soapui-plugin 4.0.1
Given a maven project with two nested multi module projects.
Each of the nested projects contains a webservice project. Service1 depends upon the Services of Service2, and both Service1 and Service2 depend on ExtService.
Each nested webservice project has its own set of integration tests which make use of maven-soapui-plugin to mock out ExtService, and Service1 has additional mocking for Service2.
Service1 depends on methodX from ExtService while Service2 has no such dependency, so the mocks configured for Service1 have ExtService.methodX while the mocks for Service2 do not.
When mvn clean install is ran for each individual nested project all tests pass as expected and build.
However when we run mvn clean install on the parent project we see test failures in Service1 (note due to the fact that Service1 depends on Service2 it is the second project to be built).
We see an error stating that we have a missing service.
Given that the mock service are now operating on different ports by the time the int tests for Service1 are being run we have two instance of maven-soapui-plugin running, each with a mock for ExtService but running on a different port. However we still get the a missing operation error during Service1 build phase.
When we add the missing service to Service2's ExtService mock the build proceeds to completion without any errors, this indicates that requests to the mocks are not being routed based upon the host and port of the request but via some other mechanism which favours the first created instance of maven-soapui-plugin or teh first created instance of a mock rather than the correct instance.
The easy fix would be to provide a shutdown goal that can be mapped to a lifecycle phase or to ensure that maven-soapui-plugin shutdown correctly at the end of a multi module lifecycle phase.