@Test public void testIntygSentMissingInWC() throws Exception { when(utkastRepo.findById(INTYG_ID)).thenReturn(Optional.empty()); doReturn(createCertificate()).when(intygService).fetchIntygDataForInternalUse(INTYG_ID, false); doReturn(Optional.of(SchemaVersion.VERSION_3)).when(mockSendNotificationStrategy).decideNotificationForIntyg(any(Utlatande.class)); doReturn(createNotificationMessage(HandelsekodEnum.SKICKA, INTYG_JSON)) .when(mockNotificationMessageFactory) .createNotificationMessage(any(), any(), any(), any(), any(), any(), any(), any(), any()); notificationService.sendNotificationForIntygSent(INTYG_ID); verifySuccessfulInvocationsForCertificate(HandelsekodEnum.SKICKA); }
@Override public void sendNotificationForIntygSent(String intygsId) { Utkast utkast = getUtkast(intygsId); if (utkast != null) { createAndSendNotification(utkast, SKICKA); } else { createAndSendNotification(intygsId, SKICKA); } }
NotificationServiceImpl implements NotificationService { @Override public void sendNotificationForIntygSent(String intygsId) { Utkast utkast = getUtkast(intygsId); if (utkast != null) { createAndSendNotification(utkast, SKICKA); } else { createAndSendNotification(intygsId, SKICKA); } } }
NotificationServiceImpl implements NotificationService { @Override public void sendNotificationForIntygSent(String intygsId) { Utkast utkast = getUtkast(intygsId); if (utkast != null) { createAndSendNotification(utkast, SKICKA); } else { createAndSendNotification(intygsId, SKICKA); } }  }
NotificationServiceImpl implements NotificationService { @Override public void sendNotificationForIntygSent(String intygsId) { Utkast utkast = getUtkast(intygsId); if (utkast != null) { createAndSendNotification(utkast, SKICKA); } else { createAndSendNotification(intygsId, SKICKA); } }  @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 void sendNotificationForIntygSent(String intygsId) { Utkast utkast = getUtkast(intygsId); if (utkast != null) { createAndSendNotification(utkast, SKICKA); } else { createAndSendNotification(intygsId, SKICKA); } }  @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);  }