Skip to content

Commit

Permalink
Merge pull request #4 from nramc/feature/1_AddSpringActuator
Browse files Browse the repository at this point in the history
[feat] #1 spring actuator added to monitor application health
  • Loading branch information
nramc authored Mar 10, 2024
2 parents 172c907 + a1756be commit d017bdb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.test.web.reactive.server.WebTestClient;

@SpringBootTest
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class JourneyApiApplicationTests {
@Autowired
private ApplicationContext applicationContext;
@Autowired
private WebTestClient webTestClient;

@Test
void contextLoads() {
Assertions.assertNotNull(applicationContext);
}

@Test
void testHealthCheckEndpoint() {
webTestClient.get().uri("/actuator/health").exchange()
.expectStatus().isOk();
}

}

0 comments on commit d017bdb

Please sign in to comment.