Search in sources :

Example 1 with FlowMirrorPointResponseV2

use of org.openkilda.northbound.dto.v2.flows.FlowMirrorPointResponseV2 in project open-kilda by telstra.

the class FlowMapperTest method testFlowMirrorPointResponseToFlowMirrorPointCreatePayload.

@Test
public void testFlowMirrorPointResponseToFlowMirrorPointCreatePayload() {
    FlowMirrorPointResponse response = FlowMirrorPointResponse.builder().flowId(FLOW_ID).mirrorPointId(MIRROR_POINT_ID_A).mirrorPointDirection(MIRROR_POINT_DIRECTION_A).mirrorPointSwitchId(SRC_SWITCH_ID).sinkEndpoint(FlowEndpoint.builder().switchId(DST_SWITCH_ID).portNumber(DST_PORT).outerVlanId(DST_VLAN).innerVlanId(DST_INNER_VLAN).build()).build();
    FlowMirrorPointResponseV2 apiResponse = flowMapper.toFlowMirrorPointResponseV2(response);
    assertEquals(response.getFlowId(), apiResponse.getFlowId());
    assertEquals(response.getMirrorPointId(), apiResponse.getMirrorPointId());
    assertEquals(response.getMirrorPointDirection(), apiResponse.getMirrorPointDirection());
    assertEquals(response.getMirrorPointSwitchId(), apiResponse.getMirrorPointSwitchId());
    assertEquals(response.getSinkEndpoint().getSwitchId(), apiResponse.getSinkEndpoint().getSwitchId());
    assertEquals(response.getSinkEndpoint().getPortNumber(), apiResponse.getSinkEndpoint().getPortNumber());
    assertEquals(response.getSinkEndpoint().getOuterVlanId(), apiResponse.getSinkEndpoint().getVlanId());
    assertEquals(response.getSinkEndpoint().getInnerVlanId(), apiResponse.getSinkEndpoint().getInnerVlanId());
}
Also used : FlowMirrorPointResponse(org.openkilda.messaging.info.flow.FlowMirrorPointResponse) FlowMirrorPointResponseV2(org.openkilda.northbound.dto.v2.flows.FlowMirrorPointResponseV2) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 FlowMirrorPointResponse (org.openkilda.messaging.info.flow.FlowMirrorPointResponse)1 FlowMirrorPointResponseV2 (org.openkilda.northbound.dto.v2.flows.FlowMirrorPointResponseV2)1