GetDataResponseMessageProcessor extends BaseNotificationMessageProcessor { @Override public void processMessage(final ObjectMessage message) { LOGGER.debug("Processing DA GET_DATA response message"); this.getResponseValues(message).ifPresent(this::processResponseValues); } @Autowired protected  GetDataResponseMessageProcessor(
            @Qualifier("domainDistributionAutomationOutboundResponseMessageRouter") final NotificationResponseMessageSender responseMessageSender,
            @Qualifier("domainDistributionAutomationInboundOsgpCoreResponsesMessageProcessorMap") final MessageProcessorMap messageProcessorMap); @Override void processMessage(final ObjectMessage message);  }
@Test void handlesResponseMessageValuesTest() throws JMSException { final String correlationUid = "CorrelationID-1"; final MessageType messageType = MessageType.GET_DATA; final String organisationIdentification = "test-org"; final String deviceIdentification = "device1"; final ResponseMessage responseMessage = new ResponseMessage.Builder().withCorrelationUid(correlationUid) .withMessageType(messageType.toString()) .withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification) .withResult(ResponseMessageResultType.OK) .withDataObject("the payload") .build(); when(this.receivedMessage.getObject()).thenReturn(responseMessage); this.getDataResponseMessageProcessor.processMessage(this.receivedMessage); verify(this.adHocManagementService, times(1)).handleGetDataResponse(responseMessage, messageType); }
@Test void noResponseHandledWhenJmsExceptionOccursTest() throws JMSException { when(this.receivedMessage.getObject()).thenThrow(new JMSException("unit test throws this JMSException")); this.getDataResponseMessageProcessor.processMessage(this.receivedMessage); verify(this.adHocManagementService, never()).handleGetDataResponse(any(), any()); }