diff --git a/backend/src/test/java/ch/puzzle/okr/controller/QuarterControllerIT.java b/backend/src/test/java/ch/puzzle/okr/controller/QuarterControllerIT.java index cfd844139f..e844454b5b 100644 --- a/backend/src/test/java/ch/puzzle/okr/controller/QuarterControllerIT.java +++ b/backend/src/test/java/ch/puzzle/okr/controller/QuarterControllerIT.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.BDDMockito; +import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; @@ -67,4 +68,11 @@ void shouldGetAllTeamsIfNoTeamsExists() throws Exception { mvc.perform(get("/api/v1/quarters").contentType(MediaType.APPLICATION_JSON)) .andExpect(MockMvcResultMatchers.status().isOk()).andExpect(jsonPath("$", Matchers.hasSize(0))); } -} \ No newline at end of file + + @Test + void shouldCallCurrentQuarterAfterRequest() throws Exception { + mvc.perform(get("/api/v1/quarters/current").contentType(MediaType.APPLICATION_JSON)); + + BDDMockito.verify(quarterBusinessService, Mockito.times(1)).getCurrentQuarter(); + } +}