Search in sources :

Example 6 with GetPrivatePractitionerType

use of se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType in project webcert by sklintyg.

the class GetPrivatePractitionerResponderTest method verifyExistingPerson.

@Test
public void verifyExistingPerson() {
    // Given
    ObjectCreator objectCreator = new ObjectCreator();
    HoSPersonType hoSPersonType = objectCreator.getHoSPersonType();
    GetPrivatePractitionerType request = defaultRequest();
    GetPrivatePractitionerResponseType expected = new GetPrivatePractitionerResponseType();
    expected.setResultCode(ResultCodeEnum.OK);
    expected.setHoSPerson(hoSPersonType);
    // When
    when(personStub.get(PERSONNUMMER)).thenReturn(hoSPersonType);
    // Call web service
    GetPrivatePractitionerResponseType actual = ws.getPrivatePractitioner("address", request);
    // Then
    assertTrue(ResultCodeEnum.OK == actual.getResultCode());
    assertEquals(HSAID, actual.getHoSPerson().getHsaId().getExtension());
    assertEquals(PERSONNUMMER, actual.getHoSPerson().getPersonId().getExtension());
    verify(personStub, times(1)).get(PERSONNUMMER);
}
Also used : GetPrivatePractitionerResponseType(se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerResponseType) HoSPersonType(se.riv.infrastructure.directory.privatepractitioner.v1.HoSPersonType) GetPrivatePractitionerType(se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType) ObjectCreator(se.inera.intyg.webcert.integration.pp.util.ObjectCreator) Test(org.junit.Test)

Example 7 with GetPrivatePractitionerType

use of se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType in project webcert by sklintyg.

the class GetPrivatePractitionerResponderTest method verifyNonExistingPerson.

@Test
public void verifyNonExistingPerson() {
    // Given
    GetPrivatePractitionerType request = defaultRequest();
    request.setPersonalIdentityNumber("1901010101-0101");
    // When
    when(personStub.get("1901010101-0101")).thenReturn(null);
    // Call web service
    GetPrivatePractitionerResponseType actual = ws.getPrivatePractitioner("address", request);
    // Then
    assertTrue(ResultCodeEnum.INFO == actual.getResultCode());
    assertNull(actual.getHoSPerson());
    verify(personStub, times(1)).get("1901010101-0101");
}
Also used : GetPrivatePractitionerResponseType(se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerResponseType) GetPrivatePractitionerType(se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType) Test(org.junit.Test)

Example 8 with GetPrivatePractitionerType

use of se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType in project webcert by sklintyg.

the class PPServiceImpl method getPrivatePractitioner.

@Override
public HoSPersonType getPrivatePractitioner(String logicalAddress, String hsaIdentityNumber, String personalIdentityNumber) {
    LOG.debug("Getting person information from Privatläkarportalen.");
    // Exakt ett av fälten hsaIdentityNumber och personalIdentityNumber ska anges.
    validateIdentifier(hsaIdentityNumber, personalIdentityNumber);
    GetPrivatePractitionerType request = createPrivatePractitionerType(hsaIdentityNumber, personalIdentityNumber);
    return getPrivatePractitioner(logicalAddress, request);
}
Also used : GetPrivatePractitionerType(se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType)

Aggregations

GetPrivatePractitionerType (se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType)6 GetPrivatePractitionerResponseType (se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerResponseType)4 Test (org.junit.Test)3 HoSPersonType (se.riv.infrastructure.directory.privatepractitioner.v1.HoSPersonType)3 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)2 Personnummer (se.inera.intyg.schemas.contract.Personnummer)1 ObjectCreator (se.inera.intyg.webcert.integration.pp.util.ObjectCreator)1