Skip to content

Commit 069db11

Browse files
small fix
1 parent 1e2f283 commit 069db11

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

service/src/intTest/java/uk/nhs/adaptors/gp2gp/ehr/IllogicalMessageComponentTest.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,8 @@
4848
@SpringBootTest
4949
@DirtiesContext
5050
public class IllogicalMessageComponentTest {
51-
private static final String INTERACTION_ID_PATH = "/RCMR_IN010000UK05";
52-
private static final String SUBJECT_PATH = INTERACTION_ID_PATH + "/ControlActEvent/subject";
53-
private static final String MESSAGE_HEADER_PATH = "/Envelope/Header/MessageHeader";
54-
private static final String REQUEST_ID_PATH = SUBJECT_PATH + "/EhrRequest/id/@root";
55-
private static final String NHS_NUMBER_PATH = SUBJECT_PATH + "/EhrRequest/recordTarget/patient/id/@extension";
56-
private static final String FROM_PARTY_ID_PATH = MESSAGE_HEADER_PATH + "/From/PartyId";
57-
private static final String TO_PARTY_ID_PATH = MESSAGE_HEADER_PATH + "/To/PartyId";
58-
private static final String FROM_ASID_PATH = INTERACTION_ID_PATH + "/communicationFunctionSnd/device/id/@extension";
59-
private static final String TO_ASID_PATH = INTERACTION_ID_PATH + "/communicationFunctionRcv/device/id/@extension";
60-
private static final String FROM_ODS_CODE_PATH = SUBJECT_PATH + "/EhrRequest/author/AgentOrgSDS/agentOrganizationSDS/id/@extension";
61-
private static final String TO_ODS_CODE_PATH = SUBJECT_PATH + "/EhrRequest/destination/AgentOrgSDS/agentOrganizationSDS/id/@extension";
62-
private static final String MESSAGE_ID_PATH = MESSAGE_HEADER_PATH + "/MessageData/MessageId";
6351
private static final String CONTINUE_REQUEST = "COPC_IN000001UK01";
6452
private static final String ACKNOWLEDGMENT_REQUEST = "MCCI_IN010000UK13";
65-
private static final String ACTION_PATH = "/Envelope/Header/MessageHeader/Action";
66-
private static final String CONVERSATION_ID_PATH = "/Envelope/Header/MessageHeader/ConversationId";
6753
private static final String NON_EXISTING_CONVERSATION_ID = "d3746650-096e-414b-92a4-146ceaf74f0e";
6854
private static final XPathService SERVICE = new XPathService();
6955

@@ -221,32 +207,6 @@ public void When_UnsupportedMessageSent_Expect_ErrorThrown() {
221207
verify(taskDispatcher, never()).createTask(any());
222208
}
223209

224-
@SneakyThrows
225-
private void mockEhrRequest(String ebxml, String payload, String interactionId, String conversationId) {
226-
String incomingMessage = null;
227-
when(objectMapper.readValue(incomingMessage, InboundMessage.class)).thenReturn(inboundMessage);
228-
when(inboundMessage.getEbXML()).thenReturn(ebxml);
229-
when(inboundMessage.getPayload()).thenReturn(payload);
230-
231-
var ebxmlDocument = SERVICE.parseDocumentFromXml(ebxml);
232-
when(xPathService.parseDocumentFromXml(inboundMessage.getEbXML())).thenReturn(ebxmlDocument);
233-
var payloadDocument = SERVICE.parseDocumentFromXml(payload);
234-
when(xPathService.parseDocumentFromXml(inboundMessage.getPayload())).thenReturn(payloadDocument);
235-
236-
when(xPathService.getNodeValue(ebxmlDocument, ACTION_PATH)).thenReturn(interactionId);
237-
when(xPathService.getNodeValue(ebxmlDocument, CONVERSATION_ID_PATH)).thenReturn(conversationId);
238-
239-
when(xPathService.getNodeValue(payloadDocument, REQUEST_ID_PATH)).thenReturn("123");
240-
when(xPathService.getNodeValue(payloadDocument, NHS_NUMBER_PATH)).thenReturn("123");
241-
when(xPathService.getNodeValue(ebxmlDocument, FROM_PARTY_ID_PATH)).thenReturn("123");
242-
when(xPathService.getNodeValue(ebxmlDocument, TO_PARTY_ID_PATH)).thenReturn("123");
243-
when(xPathService.getNodeValue(payloadDocument, FROM_ASID_PATH)).thenReturn("123");
244-
when(xPathService.getNodeValue(payloadDocument, TO_ASID_PATH)).thenReturn("123");
245-
when(xPathService.getNodeValue(payloadDocument, FROM_ODS_CODE_PATH)).thenReturn("123");
246-
when(xPathService.getNodeValue(payloadDocument, TO_ODS_CODE_PATH)).thenReturn("123");
247-
when(xPathService.getNodeValue(ebxmlDocument, MESSAGE_ID_PATH)).thenReturn("123");
248-
}
249-
250210
private static String asString(Resource resource) {
251211
try (Reader reader = new InputStreamReader(resource.getInputStream(), UTF_8)) {
252212
return FileCopyUtils.copyToString(reader);

0 commit comments

Comments
 (0)