use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testValidateHosPersonalPersonalIdExtensionMissing.
@Test
public void testValidateHosPersonalPersonalIdExtensionMissing() {
ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", "förnamn", "19121212-1212", "fullständigt namn", "", "enhetsnamn", "enhetHsaId", true));
assertTrue(result.hasErrors());
}
use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testValidateHoSPersonalEnhetsnamnMissing.
@Test
public void testValidateHoSPersonalEnhetsnamnMissing() {
ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", "fornamn", "fullständigt namn", null, true));
assertTrue(result.hasErrors());
}
use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testPuServiceLooksUpPatientForTsBas.
@Test
public void testPuServiceLooksUpPatientForTsBas() {
when(patientDetailsResolver.getPersonFromPUService(any(Personnummer.class))).thenReturn(buildPersonSvar(PersonSvar.Status.FOUND));
when(patientDetailsResolver.getSekretessStatus(any(Personnummer.class))).thenReturn(SekretessStatus.FALSE);
ResultValidator result = validator.validateApplicationErrors(buildIntyg(TSBAS, "efternamn", "förnamn", "fullständigt namn", "enhetsnamn", true), user);
assertFalse(result.hasErrors());
verify(patientDetailsResolver).getSekretessStatus(any(Personnummer.class));
}
use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testCreateDOIAllowedWhenPatientIsDeceased.
@Test
public void testCreateDOIAllowedWhenPatientIsDeceased() {
when(patientDetailsResolver.getPersonFromPUService(any(Personnummer.class))).thenReturn(buildPersonSvar(PersonSvar.Status.FOUND));
when(patientDetailsResolver.getSekretessStatus(any(Personnummer.class))).thenReturn(SekretessStatus.FALSE);
when(patientDetailsResolver.isAvliden(any(Personnummer.class))).thenReturn(true);
ResultValidator result = validator.validateApplicationErrors(buildIntyg(DoiModuleEntryPoint.MODULE_ID, "efternamn", "förnamn", "fullständigt namn", "enhetsnamn", true), buildUserUnauthorized());
assertFalse(result.hasErrors());
verify(patientDetailsResolver).isAvliden(any(Personnummer.class));
}
use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testValidatePatientFornamnMissing.
@Test
public void testValidatePatientFornamnMissing() {
ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", null, "fullständigt namn", "enhetsnamn", true));
assertTrue(result.hasErrors());
}
Aggregations