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);
}
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");
}
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);
}
Aggregations