@Test public void testQuestionReceivedFragaSvarIntegreradEnhet() throws Exception { when(integreradeEnheterRegistry.isEnhetIntegrerad(ENHET_ID, INTYG_TYP_FK)).thenReturn(true); when(utkastRepo.findById(INTYG_ID)).thenReturn(Optional.of(createUtkast())); notificationService.sendNotificationForQuestionReceived(createFragaSvar()); verifySuccessfulInvocations(HandelsekodEnum.NYFRFM); }
@Override public void sendNotificationForQuestionReceived(FragaSvar fragaSvar) { if (integreradeEnheterRegistry.isEnhetIntegrerad(fragaSvar.getVardperson().getEnhetsId(), Fk7263EntryPoint.MODULE_ID)) { sendNotificationForQAs(fragaSvar.getIntygsReferens().getIntygsId(), NotificationEvent.NEW_QUESTION_FROM_RECIPIENT, fragaSvar.getSistaDatumForSvar(), ArendeAmne.fromAmne(fragaSvar.getAmne()).orElse(null)); } else { sendNotificationForIncomingQuestionByMail(new MailNotification(fragaSvar.getInternReferens().toString(), fragaSvar.getIntygsReferens().getIntygsId(), Fk7263EntryPoint.MODULE_ID, fragaSvar.getVardperson().getEnhetsId(), fragaSvar.getVardperson().getEnhetsnamn(), fragaSvar.getVardperson().getHsaId())); } }
NotificationServiceImpl implements NotificationService { @Override public void sendNotificationForQuestionReceived(FragaSvar fragaSvar) { if (integreradeEnheterRegistry.isEnhetIntegrerad(fragaSvar.getVardperson().getEnhetsId(), Fk7263EntryPoint.MODULE_ID)) { sendNotificationForQAs(fragaSvar.getIntygsReferens().getIntygsId(), NotificationEvent.NEW_QUESTION_FROM_RECIPIENT, fragaSvar.getSistaDatumForSvar(), ArendeAmne.fromAmne(fragaSvar.getAmne()).orElse(null)); } else { sendNotificationForIncomingQuestionByMail(new MailNotification(fragaSvar.getInternReferens().toString(), fragaSvar.getIntygsReferens().getIntygsId(), Fk7263EntryPoint.MODULE_ID, fragaSvar.getVardperson().getEnhetsId(), fragaSvar.getVardperson().getEnhetsnamn(), fragaSvar.getVardperson().getHsaId())); } } }
NotificationServiceImpl implements NotificationService { @Override public void sendNotificationForQuestionReceived(FragaSvar fragaSvar) { if (integreradeEnheterRegistry.isEnhetIntegrerad(fragaSvar.getVardperson().getEnhetsId(), Fk7263EntryPoint.MODULE_ID)) { sendNotificationForQAs(fragaSvar.getIntygsReferens().getIntygsId(), NotificationEvent.NEW_QUESTION_FROM_RECIPIENT, fragaSvar.getSistaDatumForSvar(), ArendeAmne.fromAmne(fragaSvar.getAmne()).orElse(null)); } else { sendNotificationForIncomingQuestionByMail(new MailNotification(fragaSvar.getInternReferens().toString(), fragaSvar.getIntygsReferens().getIntygsId(), Fk7263EntryPoint.MODULE_ID, fragaSvar.getVardperson().getEnhetsId(), fragaSvar.getVardperson().getEnhetsnamn(), fragaSvar.getVardperson().getHsaId())); } }  }
NotificationServiceImpl implements NotificationService { @Override public void sendNotificationForQuestionReceived(FragaSvar fragaSvar) { if (integreradeEnheterRegistry.isEnhetIntegrerad(fragaSvar.getVardperson().getEnhetsId(), Fk7263EntryPoint.MODULE_ID)) { sendNotificationForQAs(fragaSvar.getIntygsReferens().getIntygsId(), NotificationEvent.NEW_QUESTION_FROM_RECIPIENT, fragaSvar.getSistaDatumForSvar(), ArendeAmne.fromAmne(fragaSvar.getAmne()).orElse(null)); } else { sendNotificationForIncomingQuestionByMail(new MailNotification(fragaSvar.getInternReferens().toString(), fragaSvar.getIntygsReferens().getIntygsId(), Fk7263EntryPoint.MODULE_ID, fragaSvar.getVardperson().getEnhetsId(), fragaSvar.getVardperson().getEnhetsnamn(), fragaSvar.getVardperson().getHsaId())); } }  @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 sendNotificationForQuestionReceived(FragaSvar fragaSvar) { if (integreradeEnheterRegistry.isEnhetIntegrerad(fragaSvar.getVardperson().getEnhetsId(), Fk7263EntryPoint.MODULE_ID)) { sendNotificationForQAs(fragaSvar.getIntygsReferens().getIntygsId(), NotificationEvent.NEW_QUESTION_FROM_RECIPIENT, fragaSvar.getSistaDatumForSvar(), ArendeAmne.fromAmne(fragaSvar.getAmne()).orElse(null)); } else { sendNotificationForIncomingQuestionByMail(new MailNotification(fragaSvar.getInternReferens().toString(), fragaSvar.getIntygsReferens().getIntygsId(), Fk7263EntryPoint.MODULE_ID, fragaSvar.getVardperson().getEnhetsId(), fragaSvar.getVardperson().getEnhetsnamn(), fragaSvar.getVardperson().getHsaId())); } }  @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);  }