Search in sources :

Example 6 with SendCertificateToRecipientResponseType

use of se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType in project webcert by sklintyg.

the class CertificateSendProcessorTest method testSendCertificateThrowsPermanentOnValidationError.

@Test(expected = PermanentException.class)
public void testSendCertificateThrowsPermanentOnValidationError() throws Exception {
    // Given
    SendCertificateToRecipientResponseType response = createResponse(ResultCodeType.ERROR, ErrorIdType.VALIDATION_ERROR);
    when(sendServiceClient.sendCertificate(INTYGS_ID1, PERSON_ID1, SKICKAT_AV, RECIPIENT1, LOGICAL_ADDRESS1)).thenReturn(response);
    // When
    certificateSendProcessor.process(SKICKAT_AV, INTYGS_ID1, PERSON_ID1, RECIPIENT1, LOGICAL_ADDRESS1);
    // Then
    verify(sendServiceClient).sendCertificate(INTYGS_ID1, PERSON_ID1, SKICKAT_AV, RECIPIENT1, LOGICAL_ADDRESS1);
}
Also used : SendCertificateToRecipientResponseType(se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType) Test(org.junit.Test)

Example 7 with SendCertificateToRecipientResponseType

use of se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType in project webcert by sklintyg.

the class CertificateSendProcessorTest method createResponse.

private SendCertificateToRecipientResponseType createResponse(ResultCodeType resultCodeType, ErrorIdType errorType) {
    ResultType resultType = new ResultType();
    resultType.setResultCode(resultCodeType);
    if (errorType != null) {
        resultType.setErrorId(errorType);
    }
    SendCertificateToRecipientResponseType responseType = new SendCertificateToRecipientResponseType();
    responseType.setResult(resultType);
    return responseType;
}
Also used : SendCertificateToRecipientResponseType(se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType) ResultType(se.riv.clinicalprocess.healthcond.certificate.v3.ResultType)

Example 8 with SendCertificateToRecipientResponseType

use of se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType in project webcert by sklintyg.

the class CertificateSendProcessorTest method testSendCertificate.

@Test
public void testSendCertificate() throws Exception {
    // Given
    SendCertificateToRecipientResponseType response = createResponse(ResultCodeType.OK, null);
    when(sendServiceClient.sendCertificate(INTYGS_ID1, PERSON_ID1, SKICKAT_AV, RECIPIENT1, LOGICAL_ADDRESS1)).thenReturn(response);
    // When
    certificateSendProcessor.process(SKICKAT_AV, INTYGS_ID1, PERSON_ID1, RECIPIENT1, LOGICAL_ADDRESS1);
    // Then
    verify(sendServiceClient).sendCertificate(INTYGS_ID1, PERSON_ID1, SKICKAT_AV, RECIPIENT1, LOGICAL_ADDRESS1);
}
Also used : SendCertificateToRecipientResponseType(se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType) Test(org.junit.Test)

Example 9 with SendCertificateToRecipientResponseType

use of se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType in project webcert by sklintyg.

the class CertificateSendProcessorTest method testSendCertificateOnInfoMessage.

@Test
public void testSendCertificateOnInfoMessage() throws Exception {
    // Given
    SendCertificateToRecipientResponseType response = createResponse(ResultCodeType.INFO, null);
    when(sendServiceClient.sendCertificate(INTYGS_ID1, PERSON_ID1, SKICKAT_AV, RECIPIENT1, LOGICAL_ADDRESS1)).thenReturn(response);
    // When
    certificateSendProcessor.process(SKICKAT_AV, INTYGS_ID1, PERSON_ID1, RECIPIENT1, LOGICAL_ADDRESS1);
    // Then
    verify(sendServiceClient).sendCertificate(INTYGS_ID1, PERSON_ID1, SKICKAT_AV, RECIPIENT1, LOGICAL_ADDRESS1);
}
Also used : SendCertificateToRecipientResponseType(se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType) Test(org.junit.Test)

Example 10 with SendCertificateToRecipientResponseType

use of se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType in project webcert by sklintyg.

the class CertificateSendProcessorTest method testSendCertificateThrowsTemporaryOnApplicationError.

@Test(expected = TemporaryException.class)
public void testSendCertificateThrowsTemporaryOnApplicationError() throws Exception {
    // Given
    SendCertificateToRecipientResponseType response = createResponse(ResultCodeType.ERROR, ErrorIdType.APPLICATION_ERROR);
    when(sendServiceClient.sendCertificate(INTYGS_ID1, PERSON_ID1, SKICKAT_AV, RECIPIENT1, LOGICAL_ADDRESS1)).thenReturn(response);
    // When
    certificateSendProcessor.process(SKICKAT_AV, INTYGS_ID1, PERSON_ID1, RECIPIENT1, LOGICAL_ADDRESS1);
    // Then
    verify(sendServiceClient).sendCertificate(INTYGS_ID1, PERSON_ID1, SKICKAT_AV, RECIPIENT1, LOGICAL_ADDRESS1);
}
Also used : SendCertificateToRecipientResponseType(se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType) Test(org.junit.Test)

Aggregations

SendCertificateToRecipientResponseType (se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType)12 Test (org.junit.Test)8 ResultType (se.riv.clinicalprocess.healthcond.certificate.v3.ResultType)4 SendCertificateToRecipientType (se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientType)2 WebServiceException (javax.xml.ws.WebServiceException)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1 Fk7263Utlatande (se.inera.intyg.common.fk7263.model.internal.Fk7263Utlatande)1 HoSPersonal (se.inera.intyg.common.support.model.common.internal.HoSPersonal)1 Relation (se.inera.intyg.common.support.model.common.internal.Relation)1 Utlatande (se.inera.intyg.common.support.model.common.internal.Utlatande)1 CertificateHolder (se.inera.intyg.common.support.modules.support.api.CertificateHolder)1 CertificateStateHolder (se.inera.intyg.common.support.modules.support.api.CertificateStateHolder)1 Personnummer (se.inera.intyg.schemas.contract.Personnummer)1 WebcertCertificateRelation (se.inera.intyg.webcert.common.model.WebcertCertificateRelation)1 PermanentException (se.inera.intyg.webcert.common.sender.exception.PermanentException)1 TemporaryException (se.inera.intyg.webcert.common.sender.exception.TemporaryException)1 StubLatencyAware (se.inera.intyg.webcert.intygstjanststub.mode.StubLatencyAware)1 StubModeAware (se.inera.intyg.webcert.intygstjanststub.mode.StubModeAware)1 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)1 IntygServiceResult (se.inera.intyg.webcert.web.service.intyg.dto.IntygServiceResult)1