@Test public void testGetVxlanEdges() { NetworkConfigurations nc = buildVxlanNetworkConfigurations(); Map<String, Configuration> configurations = nc.getMap(); VxlanTopology vxlanTopology = VxlanTopologyUtils.computeVxlanTopology(nc.getMap()); Set<String> includeNodes = configurations.keySet(); Set<String> includeRemoteNodes = configurations.keySet(); assertThat( getVxlanEdges(nc, includeNodes, includeRemoteNodes, vxlanTopology), equalTo( vxlanEdgeToRows( nc, includeNodes, includeRemoteNodes, EndpointPair.unordered( VxlanNode.builder().setHostname(VXLAN_NODE1).setVni(VXLAN_VNI).build(), VxlanNode.builder().setHostname(VXLAN_NODE2).setVni(VXLAN_VNI).build())) .collect(ImmutableMultiset.toImmutableMultiset()))); }
@VisibleForTesting static Multiset<Row> getVxlanEdges( NetworkConfigurations nc, Set<String> includeNodes, Set<String> includeRemoteNodes, VxlanTopology vxlanTopology) { return vxlanTopology.getGraph().edges().stream() .flatMap(edge -> vxlanEdgeToRows(nc, includeNodes, includeRemoteNodes, edge)) .collect(Collectors.toCollection(HashMultiset::create)); }
EdgesAnswerer extends Answerer { @VisibleForTesting static Multiset<Row> getVxlanEdges( NetworkConfigurations nc, Set<String> includeNodes, Set<String> includeRemoteNodes, VxlanTopology vxlanTopology) { return vxlanTopology.getGraph().edges().stream() .flatMap(edge -> vxlanEdgeToRows(nc, includeNodes, includeRemoteNodes, edge)) .collect(Collectors.toCollection(HashMultiset::create)); } }
EdgesAnswerer extends Answerer { @VisibleForTesting static Multiset<Row> getVxlanEdges( NetworkConfigurations nc, Set<String> includeNodes, Set<String> includeRemoteNodes, VxlanTopology vxlanTopology) { return vxlanTopology.getGraph().edges().stream() .flatMap(edge -> vxlanEdgeToRows(nc, includeNodes, includeRemoteNodes, edge)) .collect(Collectors.toCollection(HashMultiset::create)); } EdgesAnswerer(Question question, IBatfish batfish); }
EdgesAnswerer extends Answerer { @VisibleForTesting static Multiset<Row> getVxlanEdges( NetworkConfigurations nc, Set<String> includeNodes, Set<String> includeRemoteNodes, VxlanTopology vxlanTopology) { return vxlanTopology.getGraph().edges().stream() .flatMap(edge -> vxlanEdgeToRows(nc, includeNodes, includeRemoteNodes, edge)) .collect(Collectors.toCollection(HashMultiset::create)); } EdgesAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); }
EdgesAnswerer extends Answerer { @VisibleForTesting static Multiset<Row> getVxlanEdges( NetworkConfigurations nc, Set<String> includeNodes, Set<String> includeRemoteNodes, VxlanTopology vxlanTopology) { return vxlanTopology.getGraph().edges().stream() .flatMap(edge -> vxlanEdgeToRows(nc, includeNodes, includeRemoteNodes, edge)) .collect(Collectors.toCollection(HashMultiset::create)); } EdgesAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot);  }