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));
}
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());
}
Aggregations