@Test
public void testRetrievalOfPowerQualityEvents() throws ProtocolAdapterException {

    when(this.getResult.getResultCode()).thenReturn(AccessResultCode.SUCCESS);
    when(this.getResult.getResultData()).thenReturn(this.resultData);
    when(this.resultData.getValue()).thenReturn(this.generateDataObjects());
    final FindEventsCommandExecutor executor = new FindEventsCommandExecutor(this.dlmsHelper,
            this.dataObjectToEventListConverter);
    final List<EventDto> events = executor.execute(this.conn, this.dlmsDevice, this.findEventsRequestDto);
    assertThat(events.size()).isEqualTo(13);
    int firstEventCode = 77;
    for (final EventDto event : events) {
        assertThat(event.getEventCode()).isEqualTo(firstEventCode++);
    }
    verify(this.dlmsHelper, times(events.size())).convertDataObjectToDateTime(any(DataObject.class));
}