Initialize HemHub project foundation
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
package se.rubble.hemhub;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
class HealthControllerTest {
|
||||
|
||||
private final MockMvc mockMvc =
|
||||
MockMvcBuilders.standaloneSetup(new HealthController()).build();
|
||||
|
||||
@Test
|
||||
void healthReturnsUp() throws Exception {
|
||||
mockMvc.perform(get("/api/health"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.status").value("UP"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user