|
1 | 1 | package uk.gov.hmcts.cp.controllers; |
2 | 2 |
|
| 3 | +import jakarta.annotation.Resource; |
3 | 4 | import org.junit.jupiter.api.DisplayName; |
4 | 5 | import org.junit.jupiter.api.Test; |
5 | 6 | import org.junit.jupiter.api.extension.ExtendWith; |
6 | | -import org.springframework.beans.factory.annotation.Autowired; |
7 | 7 | import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; |
8 | 8 | import org.springframework.boot.test.context.SpringBootTest; |
9 | 9 | import org.springframework.test.context.junit.jupiter.SpringExtension; |
10 | 10 | import org.springframework.test.web.servlet.MockMvc; |
11 | 11 |
|
12 | | -import static org.hamcrest.Matchers.containsString; |
13 | 12 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; |
14 | 13 | import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; |
15 | | -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; |
16 | 14 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; |
17 | 15 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; |
18 | 16 |
|
19 | 17 | @ExtendWith(SpringExtension.class) |
20 | | -@SpringBootTest |
21 | 18 | @AutoConfigureMockMvc |
22 | | -class RootControllerIntegrationIT { |
| 19 | +@SpringBootTest |
| 20 | +class HealthCheckIntegrationTest { |
23 | 21 |
|
24 | | - @Autowired |
| 22 | + @Resource |
25 | 23 | private MockMvc mockMvc; |
26 | 24 |
|
27 | | - @DisplayName("Should welcome upon root request with 200 response code") |
28 | | - @Test |
29 | | - void shouldCallRootAndGet200() throws Exception { |
30 | | - mockMvc.perform(get("/")) |
31 | | - .andDo(print()) |
32 | | - .andExpect(status().isOk()) |
33 | | - .andExpect(content() |
34 | | - .string(containsString("Welcome to service-hmcts-marketplace-springboot-template"))); |
35 | | - } |
36 | | - |
37 | 25 | @DisplayName("Actuator health status should be UP") |
38 | 26 | @Test |
39 | 27 | void shouldCallActuatorAndGet200() throws Exception { |
|
0 commit comments