Search in sources :

Example 1 with UniFlowPingResponse

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());
}
Also used : UniFlowPingResponse(org.openkilda.messaging.info.flow.UniFlowPingResponse) PingOutput(org.openkilda.northbound.dto.v1.flows.PingOutput) UniFlowPingResponse(org.openkilda.messaging.info.flow.UniFlowPingResponse) FlowPingResponse(org.openkilda.messaging.info.flow.FlowPingResponse) PingMeters(org.openkilda.messaging.model.PingMeters) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 FlowPingResponse (org.openkilda.messaging.info.flow.FlowPingResponse)1 UniFlowPingResponse (org.openkilda.messaging.info.flow.UniFlowPingResponse)1 PingMeters (org.openkilda.messaging.model.PingMeters)1 PingOutput (org.openkilda.northbound.dto.v1.flows.PingOutput)1