@Test public void testFindNotificationsOnUnitsWithoutTimestamp() { final var unitIds = Arrays.asList("UnitId1", "UnitId2"); final var patientId = Personnummer.createPersonnummer("191212121212").get(); final var request = new IntygWithNotificationsRequest(null, null, unitIds, null, patientId); final var notifications = Collections.EMPTY_LIST; doReturn(notifications).when(handelseRepository).findByPersonnummerAndEnhetsIdIn(patientId.getPersonnummer(), unitIds); final var actualNotifications = notificationService.findNotifications(request); assertEquals(notifications, actualNotifications); }
@Override public List<Handelse> findNotifications(IntygWithNotificationsRequest request) { final var hasStartDate = request.getStartDate() != null; final var hasEndDate = request.getEndDate() != null; if (hasStartDate && hasEndDate) { return findNotificationsBetweenTimestamp(request); } else if (hasStartDate) { return findNotificationsAfterTimestamp(request); } else if (hasEndDate) { return findNotificationsBeforeTimestamp(request); } else { return findNotificationsWithoutTimestamp(request); } }
NotificationServiceImpl implements NotificationService { @Override public List<Handelse> findNotifications(IntygWithNotificationsRequest request) { final var hasStartDate = request.getStartDate() != null; final var hasEndDate = request.getEndDate() != null; if (hasStartDate && hasEndDate) { return findNotificationsBetweenTimestamp(request); } else if (hasStartDate) { return findNotificationsAfterTimestamp(request); } else if (hasEndDate) { return findNotificationsBeforeTimestamp(request); } else { return findNotificationsWithoutTimestamp(request); } } }
NotificationServiceImpl implements NotificationService { @Override public List<Handelse> findNotifications(IntygWithNotificationsRequest request) { final var hasStartDate = request.getStartDate() != null; final var hasEndDate = request.getEndDate() != null; if (hasStartDate && hasEndDate) { return findNotificationsBetweenTimestamp(request); } else if (hasStartDate) { return findNotificationsAfterTimestamp(request); } else if (hasEndDate) { return findNotificationsBeforeTimestamp(request); } else { return findNotificationsWithoutTimestamp(request); } }  }
NotificationServiceImpl implements NotificationService { @Override public List<Handelse> findNotifications(IntygWithNotificationsRequest request) { final var hasStartDate = request.getStartDate() != null; final var hasEndDate = request.getEndDate() != null; if (hasStartDate && hasEndDate) { return findNotificationsBetweenTimestamp(request); } else if (hasStartDate) { return findNotificationsAfterTimestamp(request); } else if (hasEndDate) { return findNotificationsBeforeTimestamp(request); } else { return findNotificationsWithoutTimestamp(request); } }  @PostConstruct void checkJmsTemplate(); @Override void sendNotificationForDraftCreated(Utkast utkast); @Override void sendNotificationForDraftSigned(Utkast utkast); @Override void sendNotificationForDraftChanged(Utkast utkast); @Override void sendNotificationForDraftDeleted(Utkast utkast); @Override void sendNotificationForDraftRevoked(Utkast utkast); @Override void sendNotificationForDraftReadyToSign(Utkast utkast); @Override void sendNotificationForIntygSent(String intygsId); @Override void sendNotificationForIntygRevoked(String intygsId); @Override void sendNotificationForQuestionReceived(FragaSvar fragaSvar); @Override void sendNotificationForAnswerRecieved(FragaSvar fragaSvar); @Override void sendNotificationForQuestionReceived(Arende arende); @Override void sendNotificationForAnswerRecieved(Arende arende); @Override List<Handelse> getNotifications(String intygsId); @Override void sendNotificationForQAs(String intygsId, NotificationEvent event); @Override void forwardInternalNotification(final String intygsId, final String intygstyp, final Utlatande utlatande,
        final HandelsekodEnum handelse); @Override List<Handelse> findNotifications(IntygWithNotificationsRequest request); }
NotificationServiceImpl implements NotificationService { @Override public List<Handelse> findNotifications(IntygWithNotificationsRequest request) { final var hasStartDate = request.getStartDate() != null; final var hasEndDate = request.getEndDate() != null; if (hasStartDate && hasEndDate) { return findNotificationsBetweenTimestamp(request); } else if (hasStartDate) { return findNotificationsAfterTimestamp(request); } else if (hasEndDate) { return findNotificationsBeforeTimestamp(request); } else { return findNotificationsWithoutTimestamp(request); } }  @PostConstruct void checkJmsTemplate(); @Override void sendNotificationForDraftCreated(Utkast utkast); @Override void sendNotificationForDraftSigned(Utkast utkast); @Override void sendNotificationForDraftChanged(Utkast utkast); @Override void sendNotificationForDraftDeleted(Utkast utkast); @Override void sendNotificationForDraftRevoked(Utkast utkast); @Override void sendNotificationForDraftReadyToSign(Utkast utkast); @Override void sendNotificationForIntygSent(String intygsId); @Override void sendNotificationForIntygRevoked(String intygsId); @Override void sendNotificationForQuestionReceived(FragaSvar fragaSvar); @Override void sendNotificationForAnswerRecieved(FragaSvar fragaSvar); @Override void sendNotificationForQuestionReceived(Arende arende); @Override void sendNotificationForAnswerRecieved(Arende arende); @Override List<Handelse> getNotifications(String intygsId); @Override void sendNotificationForQAs(String intygsId, NotificationEvent event); @Override void forwardInternalNotification(final String intygsId, final String intygstyp, final Utlatande utlatande,
        final HandelsekodEnum handelse); @Override List<Handelse> findNotifications(IntygWithNotificationsRequest request);  }