Search in sources :

Example 1 with YFlowPingResult

use of org.openkilda.northbound.dto.v2.yflows.YFlowPingResult in project open-kilda by telstra.

the class YFlowMapperTest method pingResultTest.

@Test
public void pingResultTest() {
    YFlowPingResponse response = new YFlowPingResponse(Y_FLOW_ID, false, ERROR_MESSAGE, Lists.newArrayList(new SubFlowPingPayload(SUB_FLOW_1, new UniSubFlowPingPayload(true, null, 1), new UniSubFlowPingPayload(false, Errors.TIMEOUT, 2)), new SubFlowPingPayload(SUB_FLOW_2, new UniSubFlowPingPayload(false, Errors.DEST_NOT_AVAILABLE, 3), new UniSubFlowPingPayload(true, null, 4))));
    YFlowPingResult result = mapper.toPingResult(response);
    assertEquals(response.getYFlowId(), result.getYFlowId());
    assertEquals(response.isPingSuccess(), result.isPingSuccess());
    assertEquals(response.getError(), result.getError());
    assertEquals(response.getSubFlows().size(), result.getSubFlows().size());
    assertSubFlowPingPayload(response.getSubFlows().get(0), result.getSubFlows().get(0));
}
Also used : YFlowPingResult(org.openkilda.northbound.dto.v2.yflows.YFlowPingResult) UniSubFlowPingPayload(org.openkilda.messaging.info.flow.UniSubFlowPingPayload) YFlowPingResponse(org.openkilda.messaging.info.flow.YFlowPingResponse) UniSubFlowPingPayload(org.openkilda.messaging.info.flow.UniSubFlowPingPayload) SubFlowPingPayload(org.openkilda.messaging.info.flow.SubFlowPingPayload) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 SubFlowPingPayload (org.openkilda.messaging.info.flow.SubFlowPingPayload)1 UniSubFlowPingPayload (org.openkilda.messaging.info.flow.UniSubFlowPingPayload)1 YFlowPingResponse (org.openkilda.messaging.info.flow.YFlowPingResponse)1 YFlowPingResult (org.openkilda.northbound.dto.v2.yflows.YFlowPingResult)1