Search in sources :

Example 6 with FlowEndpointV2

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

the class FlowMapperTest method testFlowEndpointV2WithoutConnectedDevices2Constructor.

@Test
public void testFlowEndpointV2WithoutConnectedDevices2Constructor() {
    FlowEndpointV2 flowEndpointV2 = new FlowEndpointV2(SRC_SWITCH_ID, SRC_PORT, SRC_VLAN, null);
    assertNotNull(flowEndpointV2.getDetectConnectedDevices());
    assertFalse(flowEndpointV2.getDetectConnectedDevices().isArp());
    assertFalse(flowEndpointV2.getDetectConnectedDevices().isLldp());
}
Also used : FlowEndpointV2(org.openkilda.northbound.dto.v2.flows.FlowEndpointV2) Test(org.junit.Test)

Example 7 with FlowEndpointV2

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

the class FlowMapperTest method testFlowMirrorPointCreatePayloadToFlowMirrorPointCreateRequest.

@Test
public void testFlowMirrorPointCreatePayloadToFlowMirrorPointCreateRequest() {
    FlowMirrorPointPayload payload = FlowMirrorPointPayload.builder().mirrorPointId(MIRROR_POINT_ID_A).mirrorPointDirection(MIRROR_POINT_DIRECTION_A).mirrorPointSwitchId(SRC_SWITCH_ID).sinkEndpoint(new FlowEndpointV2(DST_SWITCH_ID, DST_PORT, DST_VLAN, DST_INNER_VLAN)).build();
    FlowMirrorPointCreateRequest request = flowMapper.toFlowMirrorPointCreateRequest(FLOW_ID, payload);
    assertEquals(FLOW_ID, request.getFlowId());
    assertEquals(payload.getMirrorPointId(), request.getMirrorPointId());
    assertEquals(payload.getMirrorPointDirection(), request.getMirrorPointDirection().toString().toLowerCase());
    assertEquals(payload.getMirrorPointSwitchId(), request.getMirrorPointSwitchId());
    assertEquals(payload.getSinkEndpoint().getSwitchId(), request.getSinkEndpoint().getSwitchId());
    assertEquals(payload.getSinkEndpoint().getPortNumber(), request.getSinkEndpoint().getPortNumber());
    assertEquals(payload.getSinkEndpoint().getVlanId(), request.getSinkEndpoint().getOuterVlanId());
    assertEquals(payload.getSinkEndpoint().getInnerVlanId(), request.getSinkEndpoint().getInnerVlanId());
}
Also used : FlowEndpointV2(org.openkilda.northbound.dto.v2.flows.FlowEndpointV2) FlowMirrorPointPayload(org.openkilda.northbound.dto.v2.flows.FlowMirrorPointPayload) FlowMirrorPointCreateRequest(org.openkilda.messaging.command.flow.FlowMirrorPointCreateRequest) Test(org.junit.Test)

Example 8 with FlowEndpointV2

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

the class FlowMapper method toFlowResponseV2.

/**
 * Map {@link FlowDto} into {@link FlowResponseV2}.
 */
public FlowResponseV2 toFlowResponseV2(FlowDto flowDto) {
    DetectConnectedDevicesDto connectedDevices = flowDto.getDetectConnectedDevices();
    FlowEndpointV2 source = generatedFlowSourceEndpointMap(flowDto);
    source.setDetectConnectedDevices(generatedFlowSourceEndpointConnectedDevicesMap(connectedDevices));
    FlowEndpointV2 destination = generatedFlowDestinationEndpointMap(flowDto);
    destination.setDetectConnectedDevices(generatedFlowDestinationEndpointConnectedDevicesMap(connectedDevices));
    FlowResponseV2 result = generatedMap(flowDto, source, destination);
    result.setSource(source);
    result.setDestination(destination);
    return result;
}
Also used : DetectConnectedDevicesDto(org.openkilda.messaging.model.DetectConnectedDevicesDto) FlowEndpointV2(org.openkilda.northbound.dto.v2.flows.FlowEndpointV2) FlowResponseV2(org.openkilda.northbound.dto.v2.flows.FlowResponseV2)

Aggregations

FlowEndpointV2 (org.openkilda.northbound.dto.v2.flows.FlowEndpointV2)8 Test (org.junit.Test)6 DetectConnectedDevicesDto (org.openkilda.messaging.model.DetectConnectedDevicesDto)2 FlowRequestV2 (org.openkilda.northbound.dto.v2.flows.FlowRequestV2)2 SwapFlowPayload (org.openkilda.northbound.dto.v2.flows.SwapFlowPayload)2 FlowMirrorPointCreateRequest (org.openkilda.messaging.command.flow.FlowMirrorPointCreateRequest)1 FlowRequest (org.openkilda.messaging.command.flow.FlowRequest)1 FlowResponse (org.openkilda.messaging.info.flow.FlowResponse)1 SwapFlowResponse (org.openkilda.messaging.info.flow.SwapFlowResponse)1 FlowDto (org.openkilda.messaging.model.FlowDto)1 SwitchId (org.openkilda.model.SwitchId)1 DetectConnectedDevicesV2 (org.openkilda.northbound.dto.v2.flows.DetectConnectedDevicesV2)1 FlowMirrorPointPayload (org.openkilda.northbound.dto.v2.flows.FlowMirrorPointPayload)1 FlowResponseV2 (org.openkilda.northbound.dto.v2.flows.FlowResponseV2)1 SwapFlowEndpointPayload (org.openkilda.northbound.dto.v2.flows.SwapFlowEndpointPayload)1