use of org.openkilda.messaging.Message in project open-kilda by telstra.
the class HeartBeatTest method got_heart_beat_event.
@Then("^got at least (\\d+) heart beat event$")
public void got_heart_beat_event(int expect) throws Throwable {
int beatsCount = 0;
for (ConsumerRecord<String, String> record : heartBeatConsumer.poll(500)) {
Message raw = MAPPER.readValue(record.value(), Message.class);
if (raw instanceof HeartBeat) {
beatsCount += 1;
}
}
System.out.println(String.format("Got %d heart beats.", beatsCount));
assertTrue(String.format("Actual heart beats count is %d, expect more than %d", beatsCount, expect), expect <= beatsCount);
}
Aggregations