Skip to content

Commit

Permalink
Commandes: Integration tests: configure spring-boot-maven-plugin to s…
Browse files Browse the repository at this point in the history
…tart service before running integration tests and stop it after, add IT at the end of the name of integration tests classes to execute them with Failsafe instead of Surefire. The service port is fixed to 7000 by the test properties.
  • Loading branch information
neokeld committed Dec 27, 2018
1 parent ed2197c commit 4a05a0c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language: java
jdk:
- oraclejdk8
script: cd commandes && mvn test && cd ../menus && mvn test
script: cd commandes && mvn verify && cd ../menus && mvn verify
14 changes: 14 additions & 0 deletions commandes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Spring Boot configures surefire by default, but not failsafe -->
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import reactor.core.publisher.Flux;

@SpringBootTest(classes = CommandesApplication.class)
public class ReactiveWebSocketIntegrationTest {
public class ReactiveWebSocketIT {

private final WebSocketClient socketClient = new ReactorNettyWebSocketClient();

Expand Down
2 changes: 2 additions & 0 deletions commandes/src/test/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logging.level.root=INFO
server.port = 7000

0 comments on commit 4a05a0c

Please sign in to comment.