use of org.openkilda.model.PathId in project open-kilda by telstra.
the class FermaIslRepositoryTest method createPathWithSegment.
private FlowPath createPathWithSegment(String pathId, Switch srcSwitch, Integer srcPort, Switch destSwitch, Integer destPort, long bandwidth, String sharedBandwidthGroupId) {
PathId pathIdAsObj = new PathId(pathId);
FlowPath path = FlowPath.builder().srcSwitch(srcSwitch).destSwitch(destSwitch).pathId(pathIdAsObj).bandwidth(bandwidth).sharedBandwidthGroupId(sharedBandwidthGroupId).segments(Collections.singletonList(PathSegment.builder().pathId(pathIdAsObj).srcSwitch(srcSwitch).srcPort(srcPort).destSwitch(destSwitch).destPort(destPort).build())).build();
flowPathRepository.add(path);
return path;
}
use of org.openkilda.model.PathId in project open-kilda by telstra.
the class FermaTransitVlanRepositoryTest method findUnassignedTransitVlanAndCreate.
private int findUnassignedTransitVlanAndCreate(String flowId) {
int availableVlan = transitVlanRepository.findFirstUnassignedVlan(MIN_TRANSIT_VLAN, MAX_TRANSIT_VLAN).get();
TransitVlan transitVlan = TransitVlan.builder().vlan(availableVlan).pathId(new PathId(TEST_FLOW_ID + "_path")).flowId(flowId).build();
transitVlanRepository.add(transitVlan);
return availableVlan;
}
use of org.openkilda.model.PathId in project open-kilda by telstra.
the class PathIdConverterTest method shouldConvertStringToId.
@Test
public void shouldConvertStringToId() {
// given
PathId pathId = new PathId("test_path_id");
// when
PathId actualEntity = PathIdConverter.INSTANCE.toEntityAttribute(pathId.getId());
// then
assertEquals(pathId, actualEntity);
}
use of org.openkilda.model.PathId in project open-kilda by telstra.
the class FermaVxlanRepositoryTest method findUnassignedVxlanAndCreate.
private int findUnassignedVxlanAndCreate(String flowId) {
int availableVni = vxlanRepository.findFirstUnassignedVxlan(MIN_VNI, MAX_VNI).get();
Vxlan vxlan = Vxlan.builder().vni(availableVni).pathId(new PathId(TEST_FLOW_ID + "_path")).flowId(flowId).build();
vxlanRepository.add(vxlan);
return availableVni;
}
use of org.openkilda.model.PathId in project open-kilda by telstra.
the class FermaVxlanRepositoryTest method createVxlan.
private Vxlan createVxlan() {
Vxlan vxlan = Vxlan.builder().vni(1).pathId(new PathId(TEST_FLOW_ID + "_path")).flowId(TEST_FLOW_ID).build();
vxlanRepository.add(vxlan);
return vxlan;
}
Aggregations