File tree 2 files changed +18
-1
lines changed
src/test/java/com/github/nramc/dev/journey/api
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 26
26
<groupId >org.springframework.boot</groupId >
27
27
<artifactId >spring-boot-starter-web</artifactId >
28
28
</dependency >
29
+ <dependency >
30
+ <groupId >org.springframework.boot</groupId >
31
+ <artifactId >spring-boot-starter-actuator</artifactId >
32
+ </dependency >
33
+ <dependency >
34
+ <groupId >org.springframework.boot</groupId >
35
+ <artifactId >spring-boot-starter-webflux</artifactId >
36
+ </dependency >
29
37
30
38
<dependency >
31
39
<groupId >org.springframework.boot</groupId >
Original file line number Diff line number Diff line change 5
5
import org .springframework .beans .factory .annotation .Autowired ;
6
6
import org .springframework .boot .test .context .SpringBootTest ;
7
7
import org .springframework .context .ApplicationContext ;
8
+ import org .springframework .test .web .reactive .server .WebTestClient ;
8
9
9
- @ SpringBootTest
10
+ @ SpringBootTest ( webEnvironment = SpringBootTest . WebEnvironment . RANDOM_PORT )
10
11
class JourneyApiApplicationTests {
11
12
@ Autowired
12
13
private ApplicationContext applicationContext ;
14
+ @ Autowired
15
+ private WebTestClient webTestClient ;
13
16
14
17
@ Test
15
18
void contextLoads () {
16
19
Assertions .assertNotNull (applicationContext );
17
20
}
18
21
22
+ @ Test
23
+ void testHealthCheckEndpoint () {
24
+ webTestClient .get ().uri ("/actuator/health" ).exchange ()
25
+ .expectStatus ().isOk ();
26
+ }
27
+
19
28
}
You can’t perform that action at this time.
0 commit comments