use of org.hl7.v3.COPCIN000001UK01Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageCOPC_WithTimeoutFailure_Expect_ShouldHaveCorrectNackCode.
@Test
public void When_SendNackMessageCOPC_WithTimeoutFailure_Expect_ShouldHaveCorrectNackCode() throws JAXBException {
COPCIN000001UK01Message payload = unmarshallString(readSubsequentInboundMessagePayloadFromFile(), COPCIN000001UK01Message.class);
nackAckPreparationService.sendNackMessage(NACKReason.LARGE_MESSAGE_TIMEOUT, payload, CONVERSATION_ID);
verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
assertEquals("25", ackMessageDataCaptor.getValue().getNackCode());
}
use of org.hl7.v3.COPCIN000001UK01Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageCOPC_WithAttachmentsNotReceived_Expect_ShouldHaveCorrectNackCode.
@Test
public void When_SendNackMessageCOPC_WithAttachmentsNotReceived_Expect_ShouldHaveCorrectNackCode() throws JAXBException {
COPCIN000001UK01Message payload = unmarshallString(readSubsequentInboundMessagePayloadFromFile(), COPCIN000001UK01Message.class);
nackAckPreparationService.sendNackMessage(NACKReason.LARGE_MESSAGE_ATTACHMENTS_NOT_RECEIVED, payload, CONVERSATION_ID);
verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
assertEquals("31", ackMessageDataCaptor.getValue().getNackCode());
}
use of org.hl7.v3.COPCIN000001UK01Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageCOPC_WithUnexpectedCondition_Expect_ShouldHaveCorrectNackCode.
@Test
public void When_SendNackMessageCOPC_WithUnexpectedCondition_Expect_ShouldHaveCorrectNackCode() throws JAXBException {
COPCIN000001UK01Message payload = unmarshallString(readSubsequentInboundMessagePayloadFromFile(), COPCIN000001UK01Message.class);
nackAckPreparationService.sendNackMessage(NACKReason.UNEXPECTED_CONDITION, payload, CONVERSATION_ID);
verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
assertEquals("99", ackMessageDataCaptor.getValue().getNackCode());
}
use of org.hl7.v3.COPCIN000001UK01Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageCOPC_WithNoErrors_Expect_ShouldUpdateLog.
@Test
public void When_SendNackMessageCOPC_WithNoErrors_Expect_ShouldUpdateLog() throws JAXBException {
COPCIN000001UK01Message payload = unmarshallString(readSubsequentInboundMessagePayloadFromFile(), COPCIN000001UK01Message.class);
when(sendNACKMessageHandler.prepareAndSendMessage(any(NACKMessageData.class))).thenReturn(true);
assertTrue(nackAckPreparationService.sendNackMessage(NACKReason.LARGE_MESSAGE_GENERAL_FAILURE, payload, CONVERSATION_ID));
verify(migrationStatusLogService).addMigrationStatusLog(ERROR_LRG_MSG_GENERAL_FAILURE, CONVERSATION_ID);
}
use of org.hl7.v3.COPCIN000001UK01Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageCOPC_WithClinicalSysIntegrationFailure_Expect_ShouldHaveCorrectNackCode.
@Test
public void When_SendNackMessageCOPC_WithClinicalSysIntegrationFailure_Expect_ShouldHaveCorrectNackCode() throws JAXBException {
COPCIN000001UK01Message payload = unmarshallString(readSubsequentInboundMessagePayloadFromFile(), COPCIN000001UK01Message.class);
nackAckPreparationService.sendNackMessage(NACKReason.CLINICAL_SYSTEM_INTEGRATION_FAILURE, payload, CONVERSATION_ID);
verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
assertEquals("11", ackMessageDataCaptor.getValue().getNackCode());
}
Aggregations