Forum Discussion
15 years ago
It appears as the SoapUIMockServiceRunner have to be started in the phase before you need it, e.g. for integration-tests use phase pre-integration-test.
I did like this when I wanted to use soapUI to mock Web Service responses during integrations test phase.
I did like this when I wanted to use soapUI to mock Web Service responses during integrations test phase.
<pluginRepositories>
<pluginRepository>
<id>eviwarePluginRepository</id>
<url>http://www.eviware.com/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<!-- Inspiration taken from http://www.java-tutorial.ch/maven/maven-integration-test -->
<build>
<plugins>
<!-- Configure the maven-surefire-plugin, i.e. unit test plugin, to exclude the integration test classes using the pattern **/*IntegrationTest.java -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
</excludes>
</configuration>
</plugin>
<!-- Configure the maven-failsafe-plugin, i.e. the integration test plugin, to exclude the integration test classes using the pattern **/*IntegrationTest.java -->
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<!--Run as part of the pre-integration-test phase in the Maven lifecycle-->
<[b]phase>pre-integration-test</phase>[/b]
<id>delegates-soapui-integration-test</id>
<configuration>
<projectFile>${pom.basedir}\delegates\src\test\resources\soapui\delegates-soapui-project.xml</projectFile>
<noBlock>true</noBlock>
</configuration>
<goals>
<!--Run the mock phase of eviware:maven-soapui-plugin-->
<goal>mock</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>