use of org.openkilda.model.FlowMirrorPath in project open-kilda by telstra.
the class FermaFlowMirrorPathRepositoryTest method shouldDeleteFlowMirrorPath.
@Test
public void shouldDeleteFlowMirrorPath() {
FlowMirrorPath path = createFlowPath(TEST_MIRROR_PATH_ID_1, 1, switchA, switchB, 2, 3, 4);
transactionManager.doInTransaction(() -> flowMirrorPathRepository.remove(path));
assertEquals(0, flowMirrorPathRepository.findAll().size());
}
use of org.openkilda.model.FlowMirrorPath in project open-kilda by telstra.
the class FermaFlowMirrorPathRepositoryTest method createTestFlowPaths.
private void createTestFlowPaths() {
FlowMirrorPath pathA = createFlowPath(TEST_MIRROR_PATH_ID_1, 1, switchA, switchB, 2, 3, 4);
FlowMirrorPath pathB = createFlowPath(TEST_MIRROR_PATH_ID_2, 2, switchA, switchC, 3, 4, 5);
flowMirrorPoints.addPaths(pathA, pathB);
}
use of org.openkilda.model.FlowMirrorPath in project open-kilda by telstra.
the class FermaFlowMirrorPathRepositoryTest method shouldFindByDestEndpoint.
@Test
public void shouldFindByDestEndpoint() {
createTestFlowPaths();
FlowMirrorPath foundPath = flowMirrorPathRepository.findByEgressEndpoint(switchC.getSwitchId(), 3, 4, 5).get();
assertEquals(switchA.getSwitchId(), foundPath.getMirrorSwitchId());
assertEquals(switchC.getSwitchId(), foundPath.getEgressSwitchId());
}
use of org.openkilda.model.FlowMirrorPath in project open-kilda by telstra.
the class FermaFlowMirrorPathRepositoryTest method shouldFindByEgressSwitchIdAndPort.
@Test
public void shouldFindByEgressSwitchIdAndPort() {
FlowMirrorPath pathA = createFlowPath(TEST_MIRROR_PATH_ID_1, 1, switchA, switchB, 2, 3, 4);
FlowMirrorPath pathB = createFlowPath(TEST_MIRROR_PATH_ID_2, 2, switchA, switchC, 3, 4, 5);
FlowMirrorPath pathC = createFlowPath(TEST_MIRROR_PATH_ID_3, 3, switchB, switchC, 3, 5, 6);
flowMirrorPoints.addPaths(pathA, pathB, pathC);
List<FlowMirrorPath> foundPaths = new ArrayList<>(flowMirrorPathRepository.findByEgressSwitchIdAndPort(switchC.getSwitchId(), 3));
assertEquals(2, foundPaths.size());
assertEquals(switchA.getSwitchId(), foundPaths.get(1).getMirrorSwitchId());
assertEquals(switchC.getSwitchId(), foundPaths.get(1).getEgressSwitchId());
assertEquals(switchB.getSwitchId(), foundPaths.get(0).getMirrorSwitchId());
assertEquals(switchC.getSwitchId(), foundPaths.get(0).getEgressSwitchId());
}
use of org.openkilda.model.FlowMirrorPath in project open-kilda by telstra.
the class FermaFlowMirrorPathRepositoryTest method shouldCreateFlowMirrorPaths.
@Test
public void shouldCreateFlowMirrorPaths() {
createTestFlowPaths();
Collection<FlowMirrorPath> allPaths = flowMirrorPathRepository.findAll();
assertThat(allPaths, hasSize(2));
FlowMirrorPath foundPath = flowMirrorPathRepository.findById(TEST_MIRROR_PATH_ID_1).get();
assertEquals(switchA.getSwitchId(), foundPath.getMirrorSwitchId());
assertEquals(switchB.getSwitchId(), foundPath.getEgressSwitchId());
FlowMirrorPoints flowMirrorPoints = flowMirrorPointsRepository.findByGroupId(TEST_GROUP_ID).get();
assertThat(flowMirrorPoints.getMirrorPaths(), hasSize(2));
}
Aggregations