-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
management: | ||
server: | ||
port: ${SPRING_ACTUATOR_PORT} | ||
endpoints: | ||
web: | ||
exposure: | ||
include: "*" | ||
spring: | ||
boot: | ||
admin: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package mucsi96.traininglog; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.mock.web.MockHttpServletResponse; | ||
|
||
import com.jayway.jsonpath.DocumentContext; | ||
import com.jayway.jsonpath.JsonPath; | ||
|
||
public class HealthTest extends BaseIntegrationTest { | ||
|
||
@Test | ||
void retunrs_status() throws Exception { | ||
MockHttpServletResponse response = mockMvc.perform(get("/actuator/health/liveness")).andReturn().getResponse(); | ||
|
||
assertThat(response.getStatus()).isEqualTo(200); | ||
DocumentContext body = JsonPath.parse(response.getContentAsString()); | ||
assertThat(body.read("$.status", String.class)).isEqualTo("UP"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters