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