Search in sources :

Example 1 with ObjectCreator

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);
}
Also used : ValidatePrivatePractitionerType(se.riv.infrastructure.directory.privatepractitioner.validateprivatepractitionerresponder.v1.ValidatePrivatePractitionerType) ValidatePrivatePractitionerResponseType(se.riv.infrastructure.directory.privatepractitioner.validateprivatepractitionerresponder.v1.ValidatePrivatePractitionerResponseType) HoSPersonType(se.riv.infrastructure.directory.privatepractitioner.v1.HoSPersonType) ObjectCreator(se.inera.intyg.webcert.integration.pp.util.ObjectCreator) Test(org.junit.Test)

Example 2 with ObjectCreator

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

Aggregations

Test (org.junit.Test)2 ObjectCreator (se.inera.intyg.webcert.integration.pp.util.ObjectCreator)2 HoSPersonType (se.riv.infrastructure.directory.privatepractitioner.v1.HoSPersonType)2 GetPrivatePractitionerResponseType (se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerResponseType)1 GetPrivatePractitionerType (se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType)1 ValidatePrivatePractitionerResponseType (se.riv.infrastructure.directory.privatepractitioner.validateprivatepractitionerresponder.v1.ValidatePrivatePractitionerResponseType)1 ValidatePrivatePractitionerType (se.riv.infrastructure.directory.privatepractitioner.validateprivatepractitionerresponder.v1.ValidatePrivatePractitionerType)1