Skip to content

Commit

Permalink
Fix unstable test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienvermeille committed Aug 11, 2023
1 parent a59bb10 commit 306bda8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void onReceiveMqttCommandShouldInvokeUpdateControls() throws Exception {
}

@Test
public void testLogMessage(CapturedOutput output) {
public void onReceiveMqttCommandShouldPrintALogMessageWhenItReceivesACommand(CapturedOutput output) {

// GIVEN
final var stoveId = 42L;
Expand All @@ -206,6 +206,8 @@ public void testLogMessage(CapturedOutput output) {
bridge.onReceiveMqttCommand(event);

// THEN
assertTrue(output.getOut().contains(format(RECEIVED_MQTT_COMMAND_FOR_STOVE_S, stoveId)));
await()
.atMost(5, SECONDS)
.untilAsserted(() -> assertTrue(output.getAll().contains(format(RECEIVED_MQTT_COMMAND_FOR_STOVE_S, stoveId))));
}
}

0 comments on commit 306bda8

Please sign in to comment.