use of se.inera.intyg.webcert.integration.pp.util.ObjectCreator in project webcert by sklintyg.
the class ValidatePrivatePractitionerResponderTest method verifyExistingPerson.
@Test
public void verifyExistingPerson() {
// Given
ObjectCreator objectCreator = new ObjectCreator();
HoSPersonType hoSPersonType = objectCreator.getHoSPersonType();
ValidatePrivatePractitionerType request = defaultRequest();
ValidatePrivatePractitionerResponseType expected = new ValidatePrivatePractitionerResponseType();
expected.setResultCode(ResultCodeEnum.OK);
// When
when(personStub.get(PERSONNUMMER)).thenReturn(hoSPersonType);
// Call web service
ValidatePrivatePractitionerResponseType actual = ws.validatePrivatePractitioner("address", request);
// Then
assertTrue(ResultCodeEnum.OK == actual.getResultCode());
verify(personStub, times(1)).get(PERSONNUMMER);
}
use of se.inera.intyg.webcert.integration.pp.util.ObjectCreator 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);
}
Aggregations