Search in sources :

Example 1 with PingOutput

use of org.openkilda.northbound.dto.v1.flows.PingOutput in project open-kilda by telstra.

the class JsonSerializationTest method verificationOutputTest.

@Test
public void verificationOutputTest() throws IOException {
    UniFlowPingOutput verification = new UniFlowPingOutput(true, "err-test", 10);
    PingOutput dto = new PingOutput(FLOW_ID, verification, verification, "error");
    assertEquals(dto, pass(dto, PingOutput.class));
}
Also used : UniFlowPingOutput(org.openkilda.northbound.dto.v1.flows.UniFlowPingOutput) UniFlowPingOutput(org.openkilda.northbound.dto.v1.flows.UniFlowPingOutput) PingOutput(org.openkilda.northbound.dto.v1.flows.PingOutput) Test(org.junit.Test)

Example 2 with PingOutput

use of org.openkilda.northbound.dto.v1.flows.PingOutput 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)2 PingOutput (org.openkilda.northbound.dto.v1.flows.PingOutput)2 FlowPingResponse (org.openkilda.messaging.info.flow.FlowPingResponse)1 UniFlowPingResponse (org.openkilda.messaging.info.flow.UniFlowPingResponse)1 PingMeters (org.openkilda.messaging.model.PingMeters)1 UniFlowPingOutput (org.openkilda.northbound.dto.v1.flows.UniFlowPingOutput)1