Skip to content

Commit

Permalink
Improve AutomationIntegrationJsonTest (#3760)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K authored Aug 19, 2023
1 parent 04eb321 commit a240105
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ public void assertThatARuleFromJsonFileIsAddedAutomatically() {
}

@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");

Expand Down Expand Up @@ -333,6 +334,7 @@ public void receive(Event e) {
};

registerService(itemEventHandler);
Thread.sleep(1000);
eventPublisher.post(ItemEventFactory.createStateEvent("myMotionItem", OnOffType.ON));
waitForAssert(() -> {
assertThat(itemEvent, is(notNullValue()));
Expand All @@ -342,7 +344,7 @@ public void receive(Event e) {
}

@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));
Expand Down Expand Up @@ -378,6 +380,7 @@ public void receive(Event e) {
};

registerService(eventHandler);
Thread.sleep(1000);
eventPublisher.post(ItemEventFactory.createStateEvent("myMotionItem", OnOffType.ON));
waitForAssert(() -> {
assertThat(itemEvent, is(notNullValue()));
Expand Down

0 comments on commit a240105

Please sign in to comment.