use of org.openkilda.model.MirrorGroup in project open-kilda by telstra.
the class FermaMirrorGroupRepositoryTest method shouldDeleteMirrorGroup.
@Test
public void shouldDeleteMirrorGroup() {
MirrorGroup mirrorGroup = createMirrorGroup();
transactionManager.doInTransaction(() -> mirrorGroupRepository.remove(mirrorGroup));
assertEquals(0, mirrorGroupRepository.findAll().size());
}
use of org.openkilda.model.MirrorGroup in project open-kilda by telstra.
the class FermaMirrorGroupRepositoryTest method findUnassignedMirrorGroupAndCreate.
private long findUnassignedMirrorGroupAndCreate(String flowId, String pathId) {
GroupId availableGroupId = mirrorGroupRepository.findFirstUnassignedGroupId(theSwitch.getSwitchId(), MIN_GROUP_ID, MAX_GROUP_ID).get();
MirrorGroup mirrorGroup = MirrorGroup.builder().switchId(theSwitch.getSwitchId()).groupId(availableGroupId).pathId(new PathId(flowId + "_" + pathId)).flowId(flowId).mirrorGroupType(MirrorGroupType.TRAFFIC_INTEGRITY).mirrorDirection(MirrorDirection.INGRESS).build();
mirrorGroupRepository.add(mirrorGroup);
return availableGroupId.getValue();
}
use of org.openkilda.model.MirrorGroup in project open-kilda by telstra.
the class FermaMirrorGroupRepositoryTest method shouldCreateMirrorGroup.
@Test
public void shouldCreateMirrorGroup() {
createMirrorGroup();
Collection<MirrorGroup> allMirrorGroups = mirrorGroupRepository.findAll();
MirrorGroup foundMirrorGroup = allMirrorGroups.iterator().next();
assertEquals(theSwitch.getSwitchId(), foundMirrorGroup.getSwitchId());
assertEquals(TEST_FLOW_ID, foundMirrorGroup.getFlowId());
}
Aggregations