@Test public void testIntygsUrlLandstingNotFk7263() { final String intygsId = "intygsId"; MailNotification mailNotification = mailNotification(intygsId, null, LuseEntryPoint.MODULE_ID); Utkast utkast = new Utkast(); when(utkastRepository.findById(intygsId)).thenReturn(Optional.of(utkast)); final String url = mailNotificationService.intygsUrl(mailNotification); assertEquals("WebCertHostUrl/webcert/web/user/basic-certificate/luse/intygsId/questions", url); verify(utkastRepository).findById(intygsId); }
@Override @Transactional(readOnly = true) public String intygsUrl(MailNotification mailNotification) { String url = String.valueOf(webCertHostUrl) + "/webcert/web/user/" + resolvePathSegment(mailNotification.getCareUnitId(), mailNotification.getCertificateId()) + "/"; if (!Fk7263EntryPoint.MODULE_ID.equalsIgnoreCase(mailNotification.getCertificateType())) { url += mailNotification.getCertificateType() + "/"; } url += mailNotification.getCertificateId() + "/questions"; if (!Strings.nullToEmpty(mailNotification.getCareUnitId()).trim().isEmpty()) { url += "?enhet=" + mailNotification.getCareUnitId(); } LOG.debug("Intygsurl: " + url); return url; }
MailNotificationServiceImpl implements MailNotificationService { @Override @Transactional(readOnly = true) public String intygsUrl(MailNotification mailNotification) { String url = String.valueOf(webCertHostUrl) + "/webcert/web/user/" + resolvePathSegment(mailNotification.getCareUnitId(), mailNotification.getCertificateId()) + "/"; if (!Fk7263EntryPoint.MODULE_ID.equalsIgnoreCase(mailNotification.getCertificateType())) { url += mailNotification.getCertificateType() + "/"; } url += mailNotification.getCertificateId() + "/questions"; if (!Strings.nullToEmpty(mailNotification.getCareUnitId()).trim().isEmpty()) { url += "?enhet=" + mailNotification.getCareUnitId(); } LOG.debug("Intygsurl: " + url); return url; } }
MailNotificationServiceImpl implements MailNotificationService { @Override @Transactional(readOnly = true) public String intygsUrl(MailNotification mailNotification) { String url = String.valueOf(webCertHostUrl) + "/webcert/web/user/" + resolvePathSegment(mailNotification.getCareUnitId(), mailNotification.getCertificateId()) + "/"; if (!Fk7263EntryPoint.MODULE_ID.equalsIgnoreCase(mailNotification.getCertificateType())) { url += mailNotification.getCertificateType() + "/"; } url += mailNotification.getCertificateId() + "/questions"; if (!Strings.nullToEmpty(mailNotification.getCareUnitId()).trim().isEmpty()) { url += "?enhet=" + mailNotification.getCareUnitId(); } LOG.debug("Intygsurl: " + url); return url; }  }
MailNotificationServiceImpl implements MailNotificationService { @Override @Transactional(readOnly = true) public String intygsUrl(MailNotification mailNotification) { String url = String.valueOf(webCertHostUrl) + "/webcert/web/user/" + resolvePathSegment(mailNotification.getCareUnitId(), mailNotification.getCertificateId()) + "/"; if (!Fk7263EntryPoint.MODULE_ID.equalsIgnoreCase(mailNotification.getCertificateType())) { url += mailNotification.getCertificateType() + "/"; } url += mailNotification.getCertificateId() + "/questions"; if (!Strings.nullToEmpty(mailNotification.getCareUnitId()).trim().isEmpty()) { url += "?enhet=" + mailNotification.getCareUnitId(); } LOG.debug("Intygsurl: " + url); return url; }  @Override @Async("threadPoolTaskExecutor") void sendMailForIncomingQuestion(MailNotification mailNotification); @Override @Async("threadPoolTaskExecutor") void sendMailForIncomingAnswer(MailNotification mailNotification); void setAdminMailAddress(String adminMailAddress); void setWebCertHostUrl(String webCertHostUrl); @Override @Transactional(readOnly = true) String intygsUrl(MailNotification mailNotification); }
MailNotificationServiceImpl implements MailNotificationService { @Override @Transactional(readOnly = true) public String intygsUrl(MailNotification mailNotification) { String url = String.valueOf(webCertHostUrl) + "/webcert/web/user/" + resolvePathSegment(mailNotification.getCareUnitId(), mailNotification.getCertificateId()) + "/"; if (!Fk7263EntryPoint.MODULE_ID.equalsIgnoreCase(mailNotification.getCertificateType())) { url += mailNotification.getCertificateType() + "/"; } url += mailNotification.getCertificateId() + "/questions"; if (!Strings.nullToEmpty(mailNotification.getCareUnitId()).trim().isEmpty()) { url += "?enhet=" + mailNotification.getCareUnitId(); } LOG.debug("Intygsurl: " + url); return url; }  @Override @Async("threadPoolTaskExecutor") void sendMailForIncomingQuestion(MailNotification mailNotification); @Override @Async("threadPoolTaskExecutor") void sendMailForIncomingAnswer(MailNotification mailNotification); void setAdminMailAddress(String adminMailAddress); void setWebCertHostUrl(String webCertHostUrl); @Override @Transactional(readOnly = true) String intygsUrl(MailNotification mailNotification);  }