use of org.openkilda.messaging.command.yflow.YFlowDto in project open-kilda by telstra.
the class YFlowReadServiceTest method shouldDumpYFlows.
@Test
public void shouldDumpYFlows() throws FlowNotFoundException {
// given
String yFlowId = "test_y_flow_1";
createYFlowViaTransit(yFlowId);
// when
List<YFlowResponse> yFlows = yFlowReadService.getAllYFlows();
// then
assertEquals(1, yFlows.size());
YFlowDto yFlow = yFlows.get(0).getYFlow();
assertNotNull(yFlow);
assertEquals(yFlowId, yFlow.getYFlowId());
assertEquals(2, yFlow.getSubFlows().size());
}
use of org.openkilda.messaging.command.yflow.YFlowDto in project open-kilda by telstra.
the class YFlowReadServiceTest method shouldFetchYFlow.
@Test
public void shouldFetchYFlow() throws FlowNotFoundException {
// given
String yFlowId = "test_y_flow_1";
createYFlowViaTransit(yFlowId);
// when
YFlowResponse yFlowResponse = yFlowReadService.getYFlow(yFlowId);
// then
YFlowDto yFlow = yFlowResponse.getYFlow();
assertNotNull(yFlow);
assertEquals(2, yFlow.getSubFlows().size());
}
use of org.openkilda.messaging.command.yflow.YFlowDto in project open-kilda by telstra.
the class YFlowReadServiceTest method shouldFetchYFlowWithProtectedPaths.
@Test
public void shouldFetchYFlowWithProtectedPaths() throws FlowNotFoundException {
// given
String yFlowId = "test_y_flow_1";
createYFlowWithProtected(yFlowId);
// when
YFlowResponse yFlowResponse = yFlowReadService.getYFlow(yFlowId);
// then
YFlowDto yFlow = yFlowResponse.getYFlow();
assertNotNull(yFlow);
assertEquals(2, yFlow.getSubFlows().size());
// and when
YFlowPathsResponse yFlowPathsResponse = yFlowReadService.getYFlowPaths(yFlowId);
// then
// Only 1 shared segment
assertEquals(2, yFlowPathsResponse.getSharedPath().getPath().size());
assertEquals(SWITCH_SHARED, yFlowPathsResponse.getSharedPath().getPath().get(0).getSwitchId());
assertEquals(SWITCH_TRANSIT, yFlowPathsResponse.getSharedPath().getPath().get(1).getSwitchId());
assertEquals(2, yFlowPathsResponse.getSubFlowPaths().size());
// The protected paths
assertEquals(2, yFlowPathsResponse.getSharedProtectedPath().getPath().size());
assertEquals(SWITCH_SHARED, yFlowPathsResponse.getSharedProtectedPath().getPath().get(0).getSwitchId());
assertEquals(SWITCH_ALT_TRANSIT, yFlowPathsResponse.getSharedProtectedPath().getPath().get(1).getSwitchId());
assertEquals(2, yFlowPathsResponse.getSubFlowProtectedPaths().size());
}
Aggregations