Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Minor test update to try and fix timing issue

Rich Turner1815df57cc55
diff --git a/test/src/test/groovy/org/openremote/test/notification/NotificationTest.groovy b/test/src/test/groovy/org/openremote/test/notification/NotificationTest.groovy
index a88d0279b..a8d8c7174 100644
--- a/test/src/test/groovy/org/openremote/test/notification/NotificationTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/notification/NotificationTest.groovy
@@ -3,6 +3,7 @@ package org.openremote.test.notification
import com.google.common.collect.Lists
import com.google.firebase.messaging.Message
import org.openremote.container.web.WebService
+import org.openremote.manager.asset.AssetProcessingService
import org.openremote.manager.asset.AssetStorageService
import org.openremote.manager.asset.console.ConsoleResourceImpl
import org.openremote.manager.notification.EmailNotificationHandler
@@ -535,6 +536,7 @@ class NotificationTest extends Specification implements ManagerContainerTrait {
def notificationService = container.getService(NotificationService.class)
def emailNotificationHandler = container.getService(EmailNotificationHandler.class)
def assetStorageService = container.getService(AssetStorageService.class)
+ def assetProcessingService = container.getService(AssetProcessingService.class)
and: "a mock email notification handler"
EmailNotificationHandler mockEmailNotificationHandler = Spy(emailNotificationHandler)
@@ -548,6 +550,9 @@ class NotificationTest extends Specification implements ManagerContainerTrait {
}
notificationService.notificationHandlerMap.put(emailNotificationHandler.getTypeName(), mockEmailNotificationHandler)
+ expect: "the container to settle"
+ assert noEventProcessedIn(assetProcessingService, 500)
+
when: "an email notification is sent to a tenant through same mechanism as rules"
def notification = new Notification(
"Test",