Search in sources :

Example 1 with SendNotificationRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.SendNotificationRequest in project open-smart-grid-platform by OSGP.

the class NotificationServiceWsTest method testMappingFromGenericSendNotificationRequest.

@Test
public void testMappingFromGenericSendNotificationRequest() {
    final GenericSendNotificationRequest genericRequest = new GenericSendNotificationRequest(this.createGenericNotification());
    final SendNotificationRequest sendNotificationRequest = this.mapperFactory.getMapperFacade().map(genericRequest, SendNotificationRequest.class);
    final Notification notification = sendNotificationRequest.getNotification();
    assertThat(notification.getMessage()).isEqualTo(MESSAGE);
    assertThat(notification.getResult()).isEqualTo(RESULT);
    assertThat(notification.getDeviceIdentification()).isEqualTo(DEVICEIDENTIFICATION);
    assertThat(notification.getCorrelationUid()).isEqualTo(CORRELATION_UID);
    assertThat(notification.getNotificationType()).isEqualTo(NOTIFICATION_TYPE);
}
Also used : SendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.SendNotificationRequest) GenericSendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericSendNotificationRequest) Notification(org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification) GenericNotification(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericNotification) GenericSendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericSendNotificationRequest) Test(org.junit.jupiter.api.Test)

Example 2 with SendNotificationRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.SendNotificationRequest in project open-smart-grid-platform by OSGP.

the class NotificationServiceWsTest method testMappingToGenericSendNotificationRequest.

@Test
public void testMappingToGenericSendNotificationRequest() {
    final SendNotificationRequest sendNotificationRequest = new SendNotificationRequest();
    sendNotificationRequest.setNotification(this.createNotification());
    final GenericSendNotificationRequest genericRequest = this.mapperFactory.getMapperFacade().map(sendNotificationRequest, GenericSendNotificationRequest.class);
    final GenericNotification genericNotification = genericRequest.getNotification();
    assertThat(genericNotification.getMessage()).isEqualTo(MESSAGE);
    assertThat(genericNotification.getResult()).isEqualTo(RESULT);
    assertThat(genericNotification.getDeviceIdentification()).isEqualTo(DEVICEIDENTIFICATION);
    assertThat(genericNotification.getCorrelationUid()).isEqualTo(CORRELATION_UID);
    assertThat(genericNotification.getNotificationType()).isEqualTo(NOTIFICATION_TYPE.name());
}
Also used : GenericNotification(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericNotification) SendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.SendNotificationRequest) GenericSendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericSendNotificationRequest) GenericSendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericSendNotificationRequest) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 GenericNotification (org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericNotification)2 GenericSendNotificationRequest (org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericSendNotificationRequest)2 SendNotificationRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.SendNotificationRequest)2 Notification (org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification)1