fix junit status race condition (#16886)

Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Bernd Weymann 2024-06-18 07:55:00 +02:00 committed by Ciprian Pascu
parent 8aa2f34f3b
commit 888bea9a0a

View File

@ -247,11 +247,20 @@ class PegelTest {
tsi = callback.getThingStatus(); tsi = callback.getThingStatus();
assertNotNull(tsi); assertNotNull(tsi);
assertEquals(ThingStatus.UNKNOWN, tsi.getStatus(), "Status"); // In function initialize scheduler is started.
assertEquals(ThingStatusDetail.NONE, tsi.getStatusDetail(), "Detail"); // If schedule took place status is ONLINE else UNKNOWN
description = tsi.getDescription(); switch (tsi.getStatus()) {
assertNotNull(description); case UNKNOWN:
assertEquals("@text/pegelonline.handler.status.wait-feedback", description, "Description"); 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(); handler.dispose();
config = new Configuration(); config = new Configuration();