use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testValidateFeatureNotActive.
@Test
public void testValidateFeatureNotActive() {
when(authoritiesHelper.isFeatureActive(eq(AuthoritiesConstants.FEATURE_HANTERA_INTYGSUTKAST), eq(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 testTsBasIsNotAllowedWhenPatientCouldNotBeLookedUpInPu.
@Test
public void testTsBasIsNotAllowedWhenPatientCouldNotBeLookedUpInPu() {
when(patientDetailsResolver.getPersonFromPUService(any(Personnummer.class))).thenReturn(buildPersonSvar(PersonSvar.Status.NOT_FOUND));
ResultValidator result = validator.validateApplicationErrors(buildIntyg(TSBAS, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true), user);
assertTrue(result.hasErrors());
verify(patientDetailsResolver).getPersonFromPUService(any(Personnummer.class));
}
use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testValidatePatientPersonIdMissing.
@Test
public void testValidatePatientPersonIdMissing() {
ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true, null));
assertTrue(result.hasErrors());
}
use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.
the class CreateDraftCertificateValidatorImplTest method testValidatePatientEfternamnMissing.
@Test
public void testValidatePatientEfternamnMissing() {
ResultValidator result = validator.validate(buildIntyg(LUSE, null, "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 testValidateIntygstypPrivilege.
@Test
public void testValidateIntygstypPrivilege() {
when(patientDetailsResolver.getPersonFromPUService(any(Personnummer.class))).thenReturn(buildPersonSvar(PersonSvar.Status.FOUND));
// We do the same validation as to view the utkast when CreateDraftCertificate.
ResultValidator result = validator.validateApplicationErrors(buildIntyg(LisjpEntryPoint.MODULE_ID, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true), user);
assertTrue(result.hasErrors());
verify(patientDetailsResolver, times(0)).getSekretessStatus(any(Personnummer.class));
}
Aggregations