Skip to content

Commit

Permalink
add integratin test for current quarter endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Oct 18, 2024
1 parent acbb7cc commit 611888e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)));
}
}

@Test
void shouldCallCurrentQuarterAfterRequest() throws Exception {
mvc.perform(get("/api/v1/quarters/current").contentType(MediaType.APPLICATION_JSON));

BDDMockito.verify(quarterBusinessService, Mockito.times(1)).getCurrentQuarter();
}
}

0 comments on commit 611888e

Please sign in to comment.