use of org.openkilda.atdd.staging.model.topology.TopologyDefinition.Isl in project open-kilda by telstra.
the class DiscoveryMechanismSteps method checkDiscoveredLinks.
@Then("^all provided links should be detected")
public void checkDiscoveredLinks() {
List<IslInfoData> discoveredLinks = topologyEngineService.getActiveLinks();
List<TopologyDefinition.Isl> expectedLinks = topologyDefinition.getIslsForActiveSwitches();
if (CollectionUtils.isEmpty(discoveredLinks) && expectedLinks.isEmpty()) {
scenario.write("There are no links discovered as expected");
return;
}
assertThat("Discovered links don't match expected", discoveredLinks, containsInAnyOrder(expectedLinks.stream().flatMap(link -> {
// in kilda we have forward and reverse isl, that's why we have to divide into 2
Isl pairedLink = Isl.factory(link.getDstSwitch(), link.getDstPort(), link.getSrcSwitch(), link.getSrcPort(), link.getMaxBandwidth());
return Stream.of(link, pairedLink);
}).map(IslMatcher::new).collect(toList())));
}
Aggregations