use of se.inera.intyg.common.support.model.common.internal.Relation in project webcert by sklintyg.
the class IntygServiceSendTest method testSendIntygThrowsExceptionWhenPUServiceIsUnavailable.
@Test(expected = WebCertServiceException.class)
public void testSendIntygThrowsExceptionWhenPUServiceIsUnavailable() throws IOException {
final String completionMeddelandeId = "meddelandeId";
Utlatande completionUtlatande = utlatande;
completionUtlatande.getGrundData().setRelation(new Relation());
completionUtlatande.getGrundData().getRelation().setRelationKod(RelationKod.KOMPLT);
completionUtlatande.getGrundData().getRelation().setMeddelandeId(completionMeddelandeId);
when(moduleFacade.getUtlatandeFromInternalModel(isNull(), anyString())).thenReturn(completionUtlatande);
when(webCertUserService.isAuthorizedForUnit(anyString(), anyString(), anyBoolean())).thenReturn(true);
when(patientDetailsResolver.getSekretessStatus(any(Personnummer.class))).thenReturn(SekretessStatus.UNDEFINED);
when(intygRepository.findOne(INTYG_ID)).thenReturn(getUtkast(INTYG_ID));
try {
intygService.sendIntyg(INTYG_ID, INTYG_TYP_FK, "FKASSA", false);
} catch (Exception e) {
verifyZeroInteractions(logService);
throw e;
}
}
Aggregations