Search in sources :

Example 26 with ResultValidator

use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.

the class CreateDraftCertificateValidatorImplTest method testValidatePatientPersonnummerOk.

@Test
public void testValidatePatientPersonnummerOk() {
    ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true, "191212121212"));
    assertFalse(result.hasErrors());
}
Also used : ResultValidator(se.inera.intyg.webcert.web.integration.validators.ResultValidator) Test(org.junit.Test) BaseCreateDraftCertificateValidatorTest(se.inera.intyg.webcert.web.integration.interactions.createdraftcertificate.BaseCreateDraftCertificateValidatorTest)

Example 27 with ResultValidator

use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.

the class CreateDraftCertificateValidatorImplTest method testValidatePatientPersonIdExtensionMissing.

@Test
public void testValidatePatientPersonIdExtensionMissing() {
    ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true, ""));
    assertTrue(result.hasErrors());
}
Also used : ResultValidator(se.inera.intyg.webcert.web.integration.validators.ResultValidator) Test(org.junit.Test) BaseCreateDraftCertificateValidatorTest(se.inera.intyg.webcert.web.integration.interactions.createdraftcertificate.BaseCreateDraftCertificateValidatorTest)

Example 28 with ResultValidator

use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.

the class CreateDraftCertificateValidatorImplTest method testDeprecatedDoesNotValidate.

@Test
public void testDeprecatedDoesNotValidate() {
    ResultValidator result = validator.validate(buildIntyg(FK7263, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true));
    assertTrue(result.hasErrors());
}
Also used : ResultValidator(se.inera.intyg.webcert.web.integration.validators.ResultValidator) Test(org.junit.Test) BaseCreateDraftCertificateValidatorTest(se.inera.intyg.webcert.web.integration.interactions.createdraftcertificate.BaseCreateDraftCertificateValidatorTest)

Example 29 with ResultValidator

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", "enhetsId", null, true));
    assertTrue(result.hasErrors());
}
Also used : ResultValidator(se.inera.intyg.webcert.web.integration.validators.ResultValidator) Test(org.junit.Test) BaseCreateDraftCertificateValidatorTest(se.inera.intyg.webcert.web.integration.interactions.createdraftcertificate.BaseCreateDraftCertificateValidatorTest)

Example 30 with ResultValidator

use of se.inera.intyg.webcert.web.integration.validators.ResultValidator in project webcert by sklintyg.

the class CreateDraftCertificateValidatorImplTest method testValidatePatientInvalidPersonnummer.

@Test
public void testValidatePatientInvalidPersonnummer() {
    ResultValidator result = validator.validate(buildIntyg(LUSE, "efternamn", "förnamn", "fullständigt namn", "enhetsId", "enhetsnamn", true, "190101010101"));
    assertTrue(result.hasErrors());
}
Also used : ResultValidator(se.inera.intyg.webcert.web.integration.validators.ResultValidator) Test(org.junit.Test) BaseCreateDraftCertificateValidatorTest(se.inera.intyg.webcert.web.integration.interactions.createdraftcertificate.BaseCreateDraftCertificateValidatorTest)

Aggregations

ResultValidator (se.inera.intyg.webcert.web.integration.validators.ResultValidator)61 Test (org.junit.Test)55 BaseCreateDraftCertificateValidatorTest (se.inera.intyg.webcert.web.integration.interactions.createdraftcertificate.BaseCreateDraftCertificateValidatorTest)44 Personnummer (se.inera.intyg.schemas.contract.Personnummer)17 BaseCreateDraftCertificateTest (se.inera.intyg.webcert.web.integration.interactions.createdraftcertificate.BaseCreateDraftCertificateTest)11 IntygUser (se.inera.intyg.infra.security.common.model.IntygUser)9 TakResult (se.inera.intyg.webcert.integration.tak.model.TakResult)8 SchemaVersion (se.inera.intyg.common.support.modules.support.api.notification.SchemaVersion)7 Intyg (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.Intyg)7 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)6 Utlatande (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Utlatande)6 CreateDraftCertificateResponseType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.CreateDraftCertificateResponseType)6 CreateDraftCertificateType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.CreateDraftCertificateType)6 TypAvIntyg (se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg)6 CreateDraftCertificateResponseType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.CreateDraftCertificateResponseType)5 CreateDraftCertificateType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.CreateDraftCertificateType)5 TypAvUtlatande (se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande)5 VardpersonReferens (se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens)4 IntegreradEnhetEntry (se.inera.intyg.webcert.web.integration.registry.dto.IntegreradEnhetEntry)4 CreateNewDraftRequest (se.inera.intyg.webcert.web.service.utkast.dto.CreateNewDraftRequest)4