@Test
public void shouldSendMeasurementReportAndLogItemWhenHandlingAsdu() throws Exception {

    // Arrange
    final ASdu asdu = AsduFactory.ofType(ASduType.M_ME_TF_1);
    final MeasurementReportDto measurementReportDto = this.mapper.map(asdu, MeasurementReportDto.class);
    final ResponseMetadata responseMetadata = new ResponseMetadata.Builder().withCorrelationUid(CORRELATION_UID)
            .withDeviceIdentification(DEVICE_IDENTIFICATION)
            .withDeviceType(DEVICE_TYPE)
            .withOrganisationIdentification(ORGANISATION_IDENTIFICATION)
            .build();
    final LogItem logItem = new LogItem(DEVICE_IDENTIFICATION, ORGANISATION_IDENTIFICATION, true, asdu.toString());
    when(this.responseMetadataFactory.createWithNewCorrelationUid(responseMetadata)).thenReturn(responseMetadata);
    when(this.converter.convert(asdu)).thenReturn(measurementReportDto);
    when(this.deviceResponseServiceRegistry.forDeviceType(DEVICE_TYPE)).thenReturn(this.deviceResponseService);
    when(this.logItemFactory.create(asdu, responseMetadata, true)).thenReturn(logItem);
    // Act
    this.asduHandler.handleAsdu(asdu, responseMetadata);
    // Assert
    verify(this.deviceResponseService).process(measurementReportDto, responseMetadata);
    verify(this.loggingService).log(logItem);
}