use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testValidateHoSPersonalEnhetsIdMissing.
@Test
public void testValidateHoSPersonalEnhetsIdMissing() {
ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", "fornamn", "fullständigt namn", null, "enhetsnamn", 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", "enhetsId", "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 testValidateInvalidIntygsTyp.
@Test
public void testValidateInvalidIntygsTyp() {
when(moduleRegistry.moduleExists(LUSE.toLowerCase())).thenReturn(false);
ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true));
assertTrue(result.hasErrors());
}
use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testTsBasIsNotAllowedWhenPatientIsSekretessmarkerad.
@Test
public void testTsBasIsNotAllowedWhenPatientIsSekretessmarkerad() {
when(authoritiesHelper.getIntygstyperAllowedForSekretessmarkering()).thenReturn(new HashSet<>(Arrays.asList(Fk7263EntryPoint.MODULE_ID)));
when(patientDetailsResolver.getPersonFromPUService(any(Personnummer.class))).thenReturn(buildPersonSvar(PersonSvar.Status.FOUND));
when(patientDetailsResolver.getSekretessStatus(any(Personnummer.class))).thenReturn(SekretessStatus.TRUE);
ResultValidator result = validator.validateApplicationErrors(buildIntyg(TSBAS, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true), user);
assertTrue(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 testValidatePatientFornamnMissing.
@Test
public void testValidatePatientFornamnMissing() {
ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", null, "fullständigt namn", "enhetsId", "enhetsnamn", true));
assertTrue(result.hasErrors());
}
Aggregations