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();
assertNotNull(tsi);
assertEquals(ThingStatus.UNKNOWN, tsi.getStatus(), "Status");
// 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();