src-java/base-topology/base-storm-topology/src/test/java/org/openkilda/wfm/share/flow/TestFlowBuilder.java
/**
     * Build a UnidirectionalFlow with set properties.
     */
Build a UnidirectionalFlow with set properties.
Build a UnidirectionalFlow with set properties .
public FlowPathsWithEncapsulation buildFlowPathsWithEncapsulation() {
        Flow flow = build();
        EncapsulationResources encapsulationResources = null;
        if (FlowEncapsulationType.TRANSIT_VLAN.equals(encapsulationType)) {
            TransitVlan transitVlan = TransitVlan.builder()
                    .flowId(flowId)
                    .pathId(flow.getForwardPath().getPathId())
                    .vlan(transitEncapsulationId > 0 ? transitEncapsulationId : srcVlan + destVlan + 1)
                    .build();
            encapsulationResources = TransitVlanEncapsulation.builder().transitVlan(transitVlan).build();
        } else if (FlowEncapsulationType.VXLAN.equals(encapsulationType)) {
            Vxlan vxlan = Vxlan.builder()
                    .flowId(flowId)
                    .pathId(flow.getForwardPath().getPathId())
                    .vni(transitEncapsulationId > 0 ? transitEncapsulationId : srcVlan + destVlan + 1)
                    .build();
            encapsulationResources = VxlanEncapsulation.builder().vxlan(vxlan).build();
        }
        return FlowPathsWithEncapsulation.builder().flow(flow).forwardPath(flow.getForwardPath())
                .forwardEncapsulation(encapsulationResources).build();
    }
public FlowPathsWithEncapsulation buildFlowPathsWithEncapsulation ( ) { Flow flow = build ( ) ; EncapsulationResources encapsulationResources = null ; if ( FlowEncapsulationType . TRANSIT_VLAN . equals ( encapsulationType ) ) { TransitVlan transitVlan = TransitVlan . builder ( ) . flowId ( flowId ) . pathId ( flow . getForwardPath ( ) . getPathId ( ) ) . vlan ( transitEncapsulationId > 0 ? transitEncapsulationId : srcVlan + destVlan + 1 ) . build ( ) ; encapsulationResources = TransitVlanEncapsulation . builder ( ) . transitVlan ( transitVlan ) . build ( ) ; } else if ( FlowEncapsulationType . VXLAN . equals ( encapsulationType ) ) { Vxlan vxlan = Vxlan . builder ( ) . flowId ( flowId ) . pathId ( flow . getForwardPath ( ) . getPathId ( ) ) . vni ( transitEncapsulationId > 0 ? transitEncapsulationId : srcVlan + destVlan + 1 ) . build ( ) ; encapsulationResources = VxlanEncapsulation . builder ( ) . vxlan ( vxlan ) . build ( ) ; } return FlowPathsWithEncapsulation . builder ( ) . flow ( flow ) . forwardPath ( flow . getForwardPath ( ) ) . forwardEncapsulation ( encapsulationResources ) . build ( ) ; }
Build a UnidirectionalFlow with set properties.
Build a UnidirectionalFlow with set properties .
//TODO: hard-coded encapsulation will be removed in Flow H&S