fixed flaky test
This commit is contained in:
parent
e03d4ccc4c
commit
1f3c7acc51
@ -340,29 +340,26 @@ public class WebsocketApiTest extends AbstractControllerTest {
|
|||||||
Assert.assertEquals(0, update.getCount());
|
Assert.assertEquals(0, update.getCount());
|
||||||
|
|
||||||
//create alarm, check count = 1
|
//create alarm, check count = 1
|
||||||
|
getWsClient().registerWaitForUpdate();
|
||||||
|
|
||||||
Alarm alarm = new Alarm();
|
Alarm alarm = new Alarm();
|
||||||
alarm.setOriginator(tenantId);
|
alarm.setOriginator(tenantId);
|
||||||
alarm.setType("TEST ALARM");
|
alarm.setType("TEST ALARM");
|
||||||
alarm.setSeverity(AlarmSeverity.WARNING);
|
alarm.setSeverity(AlarmSeverity.WARNING);
|
||||||
|
|
||||||
alarm = doPost("/api/alarm", alarm, Alarm.class);
|
alarm = doPost("/api/alarm", alarm, Alarm.class);
|
||||||
|
|
||||||
AlarmCountCmd cmd2 = new AlarmCountCmd(2, alarmCountQuery);
|
update = getWsClient().parseAlarmCountReply(getWsClient().waitForUpdate());
|
||||||
|
Assert.assertEquals(1, update.getCmdId());
|
||||||
getWsClient().send(cmd2);
|
|
||||||
|
|
||||||
update = getWsClient().parseAlarmCountReply(getWsClient().waitForReply());
|
|
||||||
Assert.assertEquals(2, update.getCmdId());
|
|
||||||
Assert.assertEquals(1, update.getCount());
|
Assert.assertEquals(1, update.getCount());
|
||||||
|
|
||||||
// set wrong entity id in filter, check count = 0
|
// set wrong entity id in filter, check count = 0
|
||||||
singleEntityFilter.setSingleEntity(tenantAdminUserId);
|
singleEntityFilter.setSingleEntity(tenantAdminUserId);
|
||||||
AlarmCountCmd cmd3 = new AlarmCountCmd(3, alarmCountQuery);
|
AlarmCountCmd cmd3 = new AlarmCountCmd(2, alarmCountQuery);
|
||||||
|
|
||||||
getWsClient().send(cmd3);
|
getWsClient().send(cmd3);
|
||||||
|
|
||||||
update = getWsClient().parseAlarmCountReply(getWsClient().waitForReply());
|
update = getWsClient().parseAlarmCountReply(getWsClient().waitForReply());
|
||||||
Assert.assertEquals(3, update.getCmdId());
|
Assert.assertEquals(2, update.getCmdId());
|
||||||
Assert.assertEquals(0, update.getCount());
|
Assert.assertEquals(0, update.getCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user