use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class SmartMeteringBaseClient method waitForNotification.
protected Notification waitForNotification(final NotificationType notificationType, final int nextWait) {
LOGGER.info("Waiting for a notification for notification type {} for at most {} milliseconds.", notificationType, nextWait);
final Notification notification = this.notificationService.getNotification(notificationType, nextWait, TimeUnit.MILLISECONDS);
return notification;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class SmartMeteringBaseClient method waitForNotification.
protected Notification waitForNotification(final int nextWait) {
LOGGER.info("Waiting for a notification for at most {} milliseconds.", nextWait);
final Notification notification = this.notificationService.getNotification(nextWait, TimeUnit.MILLISECONDS);
if (notification == null) {
LOGGER.info("Did not receive a notification within " + nextWait + " milliseconds");
}
return notification;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class SmartMeteringBaseClient method waitForNotification.
protected void waitForNotification(final String correlationUid) {
final int nextWait = this.getNextWait();
LOGGER.info("Waiting for a notification for correlation UID {} for at most {} milliseconds.", correlationUid, nextWait);
final Notification notification = this.notificationService.getNotification(correlationUid, nextWait, TimeUnit.MILLISECONDS);
if (notification == null) {
throw new AssertionError("Did not receive a notification for correlation UID: " + correlationUid + " within " + nextWait + " milliseconds");
}
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class SmartMeteringBaseClient method waitForNotification.
protected Notification waitForNotification(final NotificationType notificationType) {
final int nextWait = this.getNextWait();
final Notification notification = this.waitForNotification(notificationType, nextWait);
if (notification == null) {
throw new AssertionError("Did not receive a notification for notification type: " + notificationType + " within " + nextWait + " milliseconds");
}
return notification;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class SmartMeteringNotificationSteps method waitForNotification.
private void waitForNotification(final int maxTimeOut, final String correlationUid, final boolean expectCorrelationUid) throws Throwable {
LOGGER.info("Waiting to make sure {} notification is received for correlation UID {} for at most {} milliseconds.", expectCorrelationUid ? "a" : "no", correlationUid, maxTimeOut);
final Notification notification = this.notificationService.getNotification(correlationUid, maxTimeOut, TimeUnit.MILLISECONDS);
final boolean gotExpectedNotification = expectCorrelationUid && notification != null;
final boolean didNotGetUnexpectedNotification = !expectCorrelationUid && notification == null;
if (gotExpectedNotification || didNotGetUnexpectedNotification) {
return;
}
if (expectCorrelationUid) {
Assertions.fail("Did not receive a notification for correlation UID: " + correlationUid + " within " + maxTimeOut + " milliseconds");
} else {
Assertions.fail("Received notification for correlation UID: " + correlationUid);
}
}
Aggregations