Search in sources :

Example 1 with YFlowDto

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());
}
Also used : YFlowDto(org.openkilda.messaging.command.yflow.YFlowDto) YFlowResponse(org.openkilda.messaging.command.yflow.YFlowResponse) Test(org.junit.Test) AbstractYFlowTest(org.openkilda.wfm.topology.flowhs.service.AbstractYFlowTest)

Example 2 with YFlowDto

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());
}
Also used : YFlowDto(org.openkilda.messaging.command.yflow.YFlowDto) YFlowResponse(org.openkilda.messaging.command.yflow.YFlowResponse) Test(org.junit.Test) AbstractYFlowTest(org.openkilda.wfm.topology.flowhs.service.AbstractYFlowTest)

Example 3 with YFlowDto

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());
}
Also used : YFlowDto(org.openkilda.messaging.command.yflow.YFlowDto) YFlowResponse(org.openkilda.messaging.command.yflow.YFlowResponse) YFlowPathsResponse(org.openkilda.messaging.command.yflow.YFlowPathsResponse) Test(org.junit.Test) AbstractYFlowTest(org.openkilda.wfm.topology.flowhs.service.AbstractYFlowTest)

Aggregations

Test (org.junit.Test)3 YFlowDto (org.openkilda.messaging.command.yflow.YFlowDto)3 YFlowResponse (org.openkilda.messaging.command.yflow.YFlowResponse)3 AbstractYFlowTest (org.openkilda.wfm.topology.flowhs.service.AbstractYFlowTest)3 YFlowPathsResponse (org.openkilda.messaging.command.yflow.YFlowPathsResponse)1