Skip to content

Commit

Permalink
fix junit status race condition (openhab#16886)
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
  • Loading branch information
weymann authored and matchews committed Oct 18, 2024
1 parent fc62fcc commit 705efe8
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,20 @@ public void testInconsistentLevels() {

tsi = callback.getThingStatus();
assertNotNull(tsi);
assertEquals(ThingStatus.UNKNOWN, tsi.getStatus(), "Status");
assertEquals(ThingStatusDetail.NONE, tsi.getStatusDetail(), "Detail");
description = tsi.getDescription();
assertNotNull(description);
assertEquals("@text/pegelonline.handler.status.wait-feedback", description, "Description");
// In function initialize scheduler is started.
// If schedule took place status is ONLINE else UNKNOWN
switch (tsi.getStatus()) {
case UNKNOWN:
assertEquals(ThingStatusDetail.NONE, tsi.getStatusDetail(), "Detail");
description = tsi.getDescription();
assertNotNull(description);
assertEquals("@text/pegelonline.handler.status.wait-feedback", description, "Description");
break;
case ONLINE:
break;
default:
fail();
}

handler.dispose();
config = new Configuration();
Expand Down

0 comments on commit 705efe8

Please sign in to comment.