use of org.openkilda.messaging.info.flow.UniFlowPingResponse in project open-kilda by telstra.
the class FlowMapperTest method testPingOutput.
@Test
public void testPingOutput() {
FlowPingResponse response = new FlowPingResponse(FLOW_ID, new UniFlowPingResponse(false, Errors.TIMEOUT, null, null), new UniFlowPingResponse(true, null, new PingMeters(1, 2, 3), null), ERROR_MESSAGE);
PingOutput output = flowMapper.toPingOutput(response);
assertEquals(response.getFlowId(), output.getFlowId());
assertEquals(response.getError(), output.getError());
assertEquals(response.getForward().isPingSuccess(), output.getForward().isPingSuccess());
assertEquals(0, output.getForward().getLatency());
assertEquals(TIMEOUT_ERROR_MESSAGE, output.getForward().getError());
assertEquals(response.getReverse().isPingSuccess(), output.getReverse().isPingSuccess());
assertEquals(1, output.getReverse().getLatency());
assertNull(output.getReverse().getError());
}
Aggregations