use of se.inera.intyg.webcert.web.web.controller.moduleapi.dto.StatsResponse in project webcert by sklintyg.
the class StatModuleApiControllerTest method testGetStatisticsWithSelectedUnitVE4.
@Test
public void testGetStatisticsWithSelectedUnitVE4() {
mockUser.setValdVardenhet(ve4);
when(fragaSvarService.getNbrOfUnhandledFragaSvarForCareUnits(anyList(), anySet())).thenReturn(fragaSvarStatsMap);
when(arendeService.getNbrOfUnhandledArendenForCareUnits(anyList(), anySet())).thenReturn(arendeStatsMap);
when(intygDraftService.getNbrOfUnsignedDraftsByCareUnits(anyList())).thenReturn(intygStatsMap);
Response response = statController.getStatistics();
verify(webCertUserService).getUser();
verify(fragaSvarService).getNbrOfUnhandledFragaSvarForCareUnits(listCaptor.capture(), intygsTypSetCaptor.capture());
List<String> listArgs = listCaptor.getValue();
assertEquals(7, listArgs.size());
assertNotNull(response);
assertEquals(OK, response.getStatus());
StatsResponse statsResponse = (StatsResponse) response.getEntity();
assertNotNull(statsResponse);
assertEquals(0, statsResponse.getTotalNbrOfUnhandledFragaSvarOnSelected());
assertEquals(22, statsResponse.getTotalNbrOfUnhandledFragaSvarOnOtherThanSelected());
}
Aggregations