use of se.inera.intyg.common.support.modules.registry.IntygModule in project webcert by sklintyg.
the class IntygServiceTest method testListCertificatesForCareWithQANoNotificationsTrim.
@Test
public void testListCertificatesForCareWithQANoNotificationsTrim() throws Exception {
final LocalDateTime start = LocalDateTime.of(2017, Month.APRIL, 1, 1, 1);
final LocalDateTime end = LocalDateTime.of(2018, Month.APRIL, 1, 1, 1);
final String vardgivarId = "vardgivarId";
final String intygType = "intygType";
final String intygId = "intygId";
when(moduleRegistry.listAllModules()).thenReturn(Collections.singletonList(new IntygModule(intygType, "", "", "", "", "", "", "", "", false)));
when(utkastRepository.findDraftsByPatientAndVardgivareAndStatus(eq(PERSON_ID), eq(vardgivarId), eq(Arrays.asList(UtkastStatus.values())), eq(Collections.singleton(intygType)))).thenReturn(Collections.singletonList(getDraft(intygId)));
when(notificationService.getNotifications(eq(intygId))).thenReturn(Collections.emptyList());
List<IntygWithNotificationsResponse> res = intygService.listCertificatesForCareWithQA(new IntygWithNotificationsRequest.Builder().setPersonnummer(PERSNR).setVardgivarId(vardgivarId).setStartDate(start).setEndDate(end).build());
assertNotNull(res);
assertEquals(0, res.size());
}
Aggregations