Skip to content

Commit

Permalink
[feat] #1 spring actuator added to monitor application health
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramachandran Nellaiyappan committed Mar 10, 2024
1 parent 172c907 commit 9bff154
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<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-devtools</artifactId>
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 9bff154

Please sign in to comment.