Search in sources :

Example 11 with COPCIN000001UK01Message

use of org.hl7.v3.COPCIN000001UK01Message in project nia-patient-switching-standard-adaptor by NHSDigital.

the class NackAckPreparationServiceTest method When_SendNackMessageCOPC_WithReAssemblyFailure_Expect_ShouldHaveCorrectNackCode.

@Test
public void When_SendNackMessageCOPC_WithReAssemblyFailure_Expect_ShouldHaveCorrectNackCode() throws JAXBException {
    COPCIN000001UK01Message payload = unmarshallString(readSubsequentInboundMessagePayloadFromFile(), COPCIN000001UK01Message.class);
    nackAckPreparationService.sendNackMessage(NACKReason.LARGE_MESSAGE_REASSEMBLY_FAILURE, payload, CONVERSATION_ID);
    verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
    assertEquals("29", ackMessageDataCaptor.getValue().getNackCode());
}
Also used : COPCIN000001UK01Message(org.hl7.v3.COPCIN000001UK01Message) Test(org.junit.jupiter.api.Test)

Example 12 with COPCIN000001UK01Message

use of org.hl7.v3.COPCIN000001UK01Message in project nia-patient-switching-standard-adaptor by NHSDigital.

the class NackAckPreparationServiceTest method When_SendNackMessageCOPC_WithEHRExtractCannotBeProcessed_Expect_AddMigrationStatusLogCalledWithGeneralProcessingError.

@Test
public void When_SendNackMessageCOPC_WithEHRExtractCannotBeProcessed_Expect_AddMigrationStatusLogCalledWithGeneralProcessingError() throws JAXBException {
    COPCIN000001UK01Message payload = unmarshallString(readSubsequentInboundMessagePayloadFromFile(), COPCIN000001UK01Message.class);
    nackAckPreparationService.sendNackMessage(NACKReason.EHR_EXTRACT_CANNOT_BE_PROCESSED, payload, CONVERSATION_ID);
    verify(migrationStatusLogService).addMigrationStatusLog(migrationStatusCaptor.capture(), any());
    assertEquals(MigrationStatus.EHR_GENERAL_PROCESSING_ERROR, migrationStatusCaptor.getValue());
}
Also used : COPCIN000001UK01Message(org.hl7.v3.COPCIN000001UK01Message) Test(org.junit.jupiter.api.Test)

Aggregations

COPCIN000001UK01Message (org.hl7.v3.COPCIN000001UK01Message)12 Test (org.junit.jupiter.api.Test)11 NACKMessageData (uk.nhs.adaptors.pss.translator.model.NACKMessageData)3 ParseException (java.text.ParseException)1 ValidationException (javax.xml.bind.ValidationException)1 Document (org.w3c.dom.Document)1 SAXException (org.xml.sax.SAXException)1 PatientAttachmentLog (uk.nhs.adaptors.connector.model.PatientAttachmentLog)1 PatientMigrationRequest (uk.nhs.adaptors.connector.model.PatientMigrationRequest)1 InlineAttachmentProcessingException (uk.nhs.adaptors.pss.translator.exception.InlineAttachmentProcessingException)1 XmlUnmarshallUtil.unmarshallString (uk.nhs.adaptors.pss.translator.util.XmlUnmarshallUtil.unmarshallString)1