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