add integration profile

This commit is contained in:
DOHA 2016-12-20 22:21:38 +02:00
parent 5fc5d83907
commit 67c491912d
6 changed files with 97 additions and 11 deletions

View File

@ -215,9 +215,57 @@
<target>8</target> <target>8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<profiles>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>**/*LiveTest.java</exclude>
</excludes>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<test.mime>json</test.mime>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties> <properties>
<jackson.version>2.8.5</jackson.version> <jackson.version>2.8.5</jackson.version>
<jackson-coreutils.version>1.8</jackson-coreutils.version> <jackson-coreutils.version>1.8</jackson-coreutils.version>
@ -255,6 +303,7 @@
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -15,7 +15,7 @@ import static io.restassured.RestAssured.get;
import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.WireMockServer;
public class RestAssured2Test { public class RestAssured2IntegrationTest {
private WireMockServer wireMockServer = new WireMockServer(); private WireMockServer wireMockServer = new WireMockServer();
private static final String EVENTS_PATH = "/odds"; private static final String EVENTS_PATH = "/odds";
@ -41,7 +41,7 @@ public class RestAssured2Test {
private static String getJson() { private static String getJson() {
return Util.inputStreamToString(new RestAssured2Test().getClass() return Util.inputStreamToString(new RestAssured2IntegrationTest().getClass()
.getResourceAsStream("/odds.json")); .getResourceAsStream("/odds.json"));
} }

View File

@ -20,7 +20,7 @@ import com.github.fge.jsonschema.cfg.ValidationConfiguration;
import com.github.fge.jsonschema.main.JsonSchemaFactory; import com.github.fge.jsonschema.main.JsonSchemaFactory;
import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.WireMockServer;
public class RestAssuredTest { public class RestAssuredIntegrationTest {
private WireMockServer wireMockServer = new WireMockServer(); private WireMockServer wireMockServer = new WireMockServer();
private static final String EVENTS_PATH = "/events?id=390"; private static final String EVENTS_PATH = "/events?id=390";
@ -99,7 +99,7 @@ public class RestAssuredTest {
} }
private static String getEventJson() { private static String getEventJson() {
return Util.inputStreamToString(RestAssuredTest.class return Util.inputStreamToString(RestAssuredIntegrationTest.class
.getResourceAsStream("/event_0.json")); .getResourceAsStream("/event_0.json"));
} }

View File

@ -15,7 +15,7 @@ import static io.restassured.RestAssured.get;
import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.WireMockServer;
public class RestAssuredXML2Test { public class RestAssuredXML2IntegrationTest {
private WireMockServer wireMockServer = new WireMockServer(); private WireMockServer wireMockServer = new WireMockServer();
private static final String EVENTS_PATH = "/teachers"; private static final String EVENTS_PATH = "/teachers";
@ -42,7 +42,7 @@ public class RestAssuredXML2Test {
private static String getXml() { private static String getXml() {
return Util return Util
.inputStreamToString(new RestAssuredXML2Test().getClass().getResourceAsStream("/teachers.xml")); .inputStreamToString(new RestAssuredXML2IntegrationTest().getClass().getResourceAsStream("/teachers.xml"));
} }
@After @After

View File

@ -25,7 +25,7 @@ import com.github.fge.jsonschema.SchemaVersion;
import com.github.fge.jsonschema.cfg.ValidationConfiguration; import com.github.fge.jsonschema.cfg.ValidationConfiguration;
import com.github.fge.jsonschema.main.JsonSchemaFactory; import com.github.fge.jsonschema.main.JsonSchemaFactory;
import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.WireMockServer;
public class RestAssuredXMLTest { public class RestAssuredXMLIntegrationTest {
private WireMockServer wireMockServer = new WireMockServer(); private WireMockServer wireMockServer = new WireMockServer();
private static final String EVENTS_PATH = "/employees"; private static final String EVENTS_PATH = "/employees";
private static final String APPLICATION_XML = "application/xml"; private static final String APPLICATION_XML = "application/xml";
@ -88,7 +88,7 @@ public class RestAssuredXMLTest {
private static String getXml() { private static String getXml() {
return Util return Util
.inputStreamToString(new RestAssuredXMLTest().getClass().getResourceAsStream("/employees.xml")); .inputStreamToString(new RestAssuredXMLIntegrationTest().getClass().getResourceAsStream("/employees.xml"));
} }
@After @After

View File

@ -65,9 +65,10 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<configuration> <configuration>
<includes> <excludes>
<include>**/*IntegrationTest.java</include> <exclude>**/*IntegrationTest.java</exclude>
</includes> <exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -96,5 +97,41 @@
</plugins> </plugins>
</build> </build>
<profiles>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>**/*LiveTest.java</exclude>
</excludes>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<test.mime>json</test.mime>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> </project>