use of org.opensmartgridplatform.dto.valueobjects.EventNotificationDto in project open-smart-grid-platform by OSGP.
the class EventNotificationMessageServiceTest method sendsLightSensorReportsLightEventToDomainTest.
@Test
void sendsLightSensorReportsLightEventToDomainTest() throws UnknownEntityException {
final String deviceUid = "testUid";
final String deviceIdentification = "testIdentification";
final DateTime dateTime = DateTime.now();
final EventTypeDto eventTypeDto = EventTypeDto.LIGHT_SENSOR_REPORTS_LIGHT;
final String description = "Sensor reports light";
final Integer index = 0;
final EventNotificationDto eventNotificationDto = new EventNotificationDto(deviceUid, dateTime, eventTypeDto, description, index);
this.eventNotificationMessageService.handleEvent(deviceIdentification, eventNotificationDto);
final ArgumentMatcher<RequestMessage> matchesEventType = (final RequestMessage message) -> ((Event) message.getRequest()).getEventType() == EventType.LIGHT_SENSOR_REPORTS_LIGHT;
verify(this.domainRequestService).send(argThat(matchesEventType), eq(MessageType.EVENT_NOTIFICATION.name()), any());
}
Aggregations