Search in sources :

Example 11 with MeasurementReportDto

use of org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto in project open-smart-grid-platform by OSGP.

the class LightMeasurementDeviceResponseServiceTest method sendLightSensorStatusResponseShouldDequeueCorrelationUid.

@Test
void sendLightSensorStatusResponseShouldDequeueCorrelationUid() {
    final MeasurementReportDto measurementReportDto = MeasurementReportFactory.getMeasurementReportDto();
    final ResponseMetadata responseMetadata = new ResponseMetadata.Builder().withCorrelationUid(CORRELATION_UID).withDeviceIdentification(Iec60870DeviceFactory.LMD_1_DEVICE_IDENTIFICATION).withOrganisationIdentification(ORGANISATION_IDENTIFICATION).build();
    final Iec60870Device lightMeasurementDevice1 = Iec60870DeviceFactory.getLightMeasurementDevice1();
    final Iec60870Device lightMeasurementDevice2 = Iec60870DeviceFactory.getLightMeasurementDevice2();
    when(this.iec60870DeviceRepository.findByGatewayDeviceIdentification(Iec60870DeviceFactory.GATEWAY_DEVICE_IDENTIFICATION)).thenReturn(Arrays.asList(lightMeasurementDevice1, lightMeasurementDevice2));
    this.lightMeasurementDeviceResponseService.sendLightSensorStatusResponse(measurementReportDto, lightMeasurementDevice1, responseMetadata, "");
    verify(this.pendingRequestsQueue).dequeue(eq(Iec60870DeviceFactory.LMD_1_DEVICE_IDENTIFICATION));
}
Also used : MeasurementReportDto(org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto) Iec60870Device(org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device) ResponseMetadata(org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ResponseMetadata) Test(org.junit.jupiter.api.Test)

Aggregations

MeasurementReportDto (org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto)11 Test (org.junit.jupiter.api.Test)6 ResponseMetadata (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ResponseMetadata)4 ASdu (org.openmuc.j60870.ASdu)3 MeasurementGroupDto (org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto)3 MeasurementReportHeaderDto (org.opensmartgridplatform.dto.da.measurements.MeasurementReportHeaderDto)3 Iec60870Device (org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device)2 ArrayList (java.util.ArrayList)1 JMSException (javax.jms.JMSException)1 DeviceResponseService (org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.DeviceResponseService)1 MeasurementGroup (org.opensmartgridplatform.domain.da.measurements.MeasurementGroup)1 MeasurementReport (org.opensmartgridplatform.domain.da.measurements.MeasurementReport)1 OsgpException (org.opensmartgridplatform.shared.exceptionhandling.OsgpException)1 CorrelationIds (org.opensmartgridplatform.shared.infra.jms.CorrelationIds)1 ResponseMessage (org.opensmartgridplatform.shared.infra.jms.ResponseMessage)1 ResponseMessageResultType (org.opensmartgridplatform.shared.infra.jms.ResponseMessageResultType)1