Skip to content

Commit eaa04c6

Browse files
committed
add live profile
1 parent 8fce6c4 commit eaa04c6

3 files changed

Lines changed: 58 additions & 6 deletions

File tree

‎spring-rest/pom.xml‎

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
<plugin>
183183
<groupId>org.apache.maven.plugins</groupId>
184184
<artifactId>maven-compiler-plugin</artifactId>
185-
<version>${maven-compiler-plugin.version}</version>
186185
<configuration>
187186
<source>1.8</source>
188187
<target>1.8</target>
@@ -192,13 +191,11 @@
192191
<plugin>
193192
<groupId>org.apache.maven.plugins</groupId>
194193
<artifactId>maven-war-plugin</artifactId>
195-
<version>${maven-war-plugin.version}</version>
196194
</plugin>
197195

198196
<plugin>
199197
<groupId>org.apache.maven.plugins</groupId>
200198
<artifactId>maven-surefire-plugin</artifactId>
201-
<version>${maven-surefire-plugin.version}</version>
202199
<configuration>
203200
<excludes>
204201
<!-- <exclude>**/*ProductionTest.java</exclude> -->
@@ -234,6 +231,61 @@
234231

235232
</build>
236233

234+
<profiles>
235+
<profile>
236+
<id>live</id>
237+
<build>
238+
<plugins>
239+
<plugin>
240+
<groupId>org.codehaus.cargo</groupId>
241+
<artifactId>cargo-maven2-plugin</artifactId>
242+
<executions>
243+
<execution>
244+
<id>start-server</id>
245+
<phase>pre-integration-test</phase>
246+
<goals>
247+
<goal>start</goal>
248+
</goals>
249+
</execution>
250+
<execution>
251+
<id>stop-server</id>
252+
<phase>post-integration-test</phase>
253+
<goals>
254+
<goal>stop</goal>
255+
</goals>
256+
</execution>
257+
</executions>
258+
</plugin>
259+
260+
<plugin>
261+
<groupId>org.apache.maven.plugins</groupId>
262+
<artifactId>maven-surefire-plugin</artifactId>
263+
<executions>
264+
<execution>
265+
<phase>integration-test</phase>
266+
<goals>
267+
<goal>test</goal>
268+
</goals>
269+
<configuration>
270+
<excludes>
271+
<exclude>none</exclude>
272+
</excludes>
273+
<includes>
274+
<include>**/*LiveTest.java</include>
275+
</includes>
276+
<systemPropertyVariables>
277+
<webTarget>cargo</webTarget>
278+
</systemPropertyVariables>
279+
</configuration>
280+
</execution>
281+
</executions>
282+
</plugin>
283+
284+
</plugins>
285+
</build>
286+
</profile>
287+
</profiles>
288+
237289
<properties>
238290
<!-- Spring -->
239291

‎spring-rest/src/test/java/org/baeldung/web/test/RequestMappingLiveTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import com.jayway.restassured.RestAssured;
88

99
public class RequestMappingLiveTest {
10-
private static String BASE_URI = "http://localhost:8080/spring-rest/ex/";
10+
private static String BASE_URI = "http://localhost:8082/spring-rest/ex/";
1111

1212
@Test
1313
public void givenSimplePath_whenGetFoos_thenOk() {

spring-rest/src/test/java/org/baeldung/web/test/SpringHttpMessageConvertersIntegrationTestsCase.java renamed to spring-rest/src/test/java/org/baeldung/web/test/SpringHttpMessageConvertersLiveTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
/**
2222
* Integration Test class. Tests methods hits the server's rest services.
2323
*/
24-
public class SpringHttpMessageConvertersIntegrationTestsCase {
24+
public class SpringHttpMessageConvertersLiveTest {
2525

26-
private static String BASE_URI = "http://localhost:8080/spring-rest/";
26+
private static String BASE_URI = "http://localhost:8082/spring-rest/";
2727

2828
/**
2929
* Without specifying Accept Header, uses the default response from the

0 commit comments

Comments
 (0)