GetLightSensorStatusRequestMessageProcessor extends AbstractMessageProcessor { @Override public void process(final ClientConnection deviceConnection, final RequestMetadata requestMetadata) throws ProtocolAdapterException { final String deviceIdentification = requestMetadata.getDeviceIdentification(); final String organisationIdentification = requestMetadata.getOrganisationIdentification(); LOGGER.info("Get light sensor status request for IEC60870 device {} for organisation {}", deviceIdentification, organisationIdentification); try { this.generalInterrogationService.sendGeneralInterrogation(deviceConnection, requestMetadata); } catch (final IOException | RuntimeException e) { final String message = String.format("Requesting the light sensor status for device %s failed", deviceIdentification); throw new ProtocolAdapterException(ComponentType.PROTOCOL_IEC60870, message, e); } } GetLightSensorStatusRequestMessageProcessor(); @Override void process(final ClientConnection deviceConnection, final RequestMetadata requestMetadata);  }
@Test void testProcessShouldSendGeneralInInterrogation() throws Exception { final ConnectionParameters connectionParameters = ConnectionParameters.newBuilder() .deviceIdentification(GATEWAY_IDENTIFICATION) .build(); final DeviceConnection deviceConnection = new DeviceConnection(this.connection, connectionParameters); final RequestMetadata requestMetadata = RequestMetadataFactory.forDevice(DEVICE_IDENTIFICATION); this.getLightSensorStatusRequestMessageProcessor.process(deviceConnection, requestMetadata); verify(this.generalInterrogationService).sendGeneralInterrogation(deviceConnection, requestMetadata); }