use of org.openkilda.wfm.topology.nbworker.services.FlowOperationsService.UpdateFlowResult in project open-kilda by telstra.
the class FlowOperationsServiceTest method shouldPrepareFlowUpdateResultWithChangedMaxLatencySecondCase.
@Test
public void shouldPrepareFlowUpdateResultWithChangedMaxLatencySecondCase() {
// given: FlowPatch with max latency and MAX_LATENCY strategy
// and Flow with MAX_LATENCY strategy and no max latency
String flowId = "test_flow_id";
FlowPatch flowDto = FlowPatch.builder().flowId(flowId).maxLatency(100L).pathComputationStrategy(PathComputationStrategy.MAX_LATENCY).build();
Flow flow = Flow.builder().flowId(flowId).srcSwitch(Switch.builder().switchId(new SwitchId(1)).build()).destSwitch(Switch.builder().switchId(new SwitchId(2)).build()).pathComputationStrategy(PathComputationStrategy.MAX_LATENCY).build();
// when: compare this flows
UpdateFlowResult result = flowOperationsService.prepareFlowUpdateResult(flowDto, flow).build();
// then: needRerouteFlow flag set to true
assertTrue(result.isNeedUpdateFlow());
}
Aggregations