Skip to content

Commit e4f1be2

Browse files
committed
add integration test profile
1 parent 09825ca commit e4f1be2

4 files changed

Lines changed: 52 additions & 6 deletions

File tree

‎spring-cucumber/pom.xml‎

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,63 @@
7373

7474

7575
</dependencies>
76-
77-
78-
76+
77+
78+
7979
<build>
8080
<plugins>
8181
<plugin>
8282
<groupId>org.springframework.boot</groupId>
8383
<artifactId>spring-boot-maven-plugin</artifactId>
8484
</plugin>
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-surefire-plugin</artifactId>
88+
<configuration>
89+
<excludes>
90+
<exclude>**/*IntegrationTest.java</exclude>
91+
<exclude>**/*LiveTest.java</exclude>
92+
</excludes>
93+
</configuration>
94+
</plugin>
8595
</plugins>
8696
</build>
97+
98+
99+
<profiles>
100+
<profile>
101+
<id>integration</id>
102+
<build>
103+
<plugins>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-surefire-plugin</artifactId>
107+
<executions>
108+
<execution>
109+
<phase>integration-test</phase>
110+
<goals>
111+
<goal>test</goal>
112+
</goals>
113+
<configuration>
114+
<excludes>
115+
<exclude>**/*LiveTest.java</exclude>
116+
</excludes>
117+
<includes>
118+
<include>**/*IntegrationTest.java</include>
119+
</includes>
120+
</configuration>
121+
</execution>
122+
</executions>
123+
<configuration>
124+
<systemPropertyVariables>
125+
<test.mime>json</test.mime>
126+
</systemPropertyVariables>
127+
</configuration>
128+
</plugin>
129+
</plugins>
130+
</build>
131+
</profile>
132+
</profiles>
87133

88134

89135
</project>

spring-cucumber/src/test/java/com/baeldung/CucumberTest.java renamed to spring-cucumber/src/test/java/com/baeldung/CucumberIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
@RunWith(Cucumber.class)
88
@CucumberOptions(features = "src/test/resources")
9-
public class CucumberTest {
9+
public class CucumberIntegrationTest {
1010
}

spring-cucumber/src/test/java/com/baeldung/OtherDefs.java renamed to spring-cucumber/src/test/java/com/baeldung/OtherDefsIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import cucumber.api.java.en.Given;
44
import cucumber.api.java.en.When;
55

6-
public class OtherDefs extends SpringIntegrationTest {
6+
public class OtherDefsIntegrationTest extends SpringIntegrationTest {
77
@When("^the client calls /baeldung$")
88
public void the_client_issues_POST_hello() throws Throwable {
99
executePost("http://localhost:8080/baeldung");

spring-cucumber/src/test/java/com/baeldung/StepDefs.java renamed to spring-cucumber/src/test/java/com/baeldung/StepDefsIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import cucumber.api.java.en.Then;
1010
import cucumber.api.java.en.When;
1111

12-
public class StepDefs extends SpringIntegrationTest {
12+
public class StepDefsIntegrationTest extends SpringIntegrationTest {
1313

1414
@When("^the client calls /version$")
1515
public void the_client_issues_GET_version() throws Throwable {

0 commit comments

Comments
 (0)