fix junit status race condition (#16886)

Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
This commit is contained in:
Bernd Weymann 2024-06-18 07:55:00 +02:00 committed by GitHub
parent c6e40272c1
commit 54ba2c732b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -247,11 +247,20 @@ class PegelTest {
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();