From a2401059e56d56286949348274d95ef975184650 Mon Sep 17 00:00:00 2001 From: J-N-K Date: Sat, 19 Aug 2023 10:16:22 +0200 Subject: [PATCH] Improve AutomationIntegrationJsonTest (#3760) Signed-off-by: Jan N. Klug --- .../integration/test/AutomationIntegrationJsonTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationJsonTest.java b/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationJsonTest.java index c970d20401..9aa3cae7c8 100644 --- a/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationJsonTest.java +++ b/itests/org.openhab.core.automation.integration.tests/src/main/java/org/openhab/core/automation/integration/test/AutomationIntegrationJsonTest.java @@ -275,7 +275,8 @@ public class AutomationIntegrationJsonTest extends JavaOSGiTest { } @Test - public void assertThatARuleFromJsonFileIsAddedAutomaticallyAndTheRuntimeRuleHasResolvedModuleReferences() { + public void assertThatARuleFromJsonFileIsAddedAutomaticallyAndTheRuntimeRuleHasResolvedModuleReferences() + throws InterruptedException { logger.info( "assert that a rule from json file is added automatically and the runtime rule has resolved module references"); @@ -333,6 +334,7 @@ public class AutomationIntegrationJsonTest extends JavaOSGiTest { }; registerService(itemEventHandler); + Thread.sleep(1000); eventPublisher.post(ItemEventFactory.createStateEvent("myMotionItem", OnOffType.ON)); waitForAssert(() -> { assertThat(itemEvent, is(notNullValue())); @@ -342,7 +344,7 @@ public class AutomationIntegrationJsonTest extends JavaOSGiTest { } @Test - public void assertThatARuleFromJsonFileIsExecutedCorrectly() throws ItemNotFoundException { + public void assertThatARuleFromJsonFileIsExecutedCorrectly() throws ItemNotFoundException, InterruptedException { logger.info("assert that rule added by json is executed correctly"); waitForAssert(() -> { assertThat(ruleRegistry.getAll().isEmpty(), is(false)); @@ -378,6 +380,7 @@ public class AutomationIntegrationJsonTest extends JavaOSGiTest { }; registerService(eventHandler); + Thread.sleep(1000); eventPublisher.post(ItemEventFactory.createStateEvent("myMotionItem", OnOffType.ON)); waitForAssert(() -> { assertThat(itemEvent, is(notNullValue()));