@Test public void testConvertVrf() { Vrf vrf = convertVrf(VRF_IFACE); assertThat(vrf.getName(), equalTo(VRF_IFACE.getName())); assertThat(vrf.getAddresses(), contains(ADDR1)); }
@VisibleForTesting static Vrf convertVrf(InterfacesInterface iface) { checkArgument(isVrf(iface), "not a vrf"); Vrf vrf = new Vrf(iface.getName()); vrf.getAddresses().addAll(firstNonNull(iface.getAddresses(), ImmutableList.of())); return vrf; }
InterfaceConverter { @VisibleForTesting static Vrf convertVrf(InterfacesInterface iface) { checkArgument(isVrf(iface), "not a vrf"); Vrf vrf = new Vrf(iface.getName()); vrf.getAddresses().addAll(firstNonNull(iface.getAddresses(), ImmutableList.of())); return vrf; } }
InterfaceConverter { @VisibleForTesting static Vrf convertVrf(InterfacesInterface iface) { checkArgument(isVrf(iface), "not a vrf"); Vrf vrf = new Vrf(iface.getName()); vrf.getAddresses().addAll(firstNonNull(iface.getAddresses(), ImmutableList.of())); return vrf; } InterfaceConverter(CumulusInterfacesConfiguration interfaces, Warnings w); }
InterfaceConverter { @VisibleForTesting static Vrf convertVrf(InterfacesInterface iface) { checkArgument(isVrf(iface), "not a vrf"); Vrf vrf = new Vrf(iface.getName()); vrf.getAddresses().addAll(firstNonNull(iface.getAddresses(), ImmutableList.of())); return vrf; } InterfaceConverter(CumulusInterfacesConfiguration interfaces, Warnings w); Map<String, Bond> convertBonds(); @Nullable Bridge convertBridge(); Map<String, org.batfish.representation.cumulus.Interface> convertInterfaces(); Map<String, Vlan> convertVlans(); Map<String, Vrf> convertVrfs(); Map<String, Vxlan> convertVxlans(); @VisibleForTesting @Nullable static String getSuperInterfaceName(String ifaceName); @VisibleForTesting @Nullable static Integer getEncapsulationVlan(InterfacesInterface iface); static boolean isBond(InterfacesInterface iface); static boolean isVlan(InterfacesInterface iface); static boolean isVxlan(InterfacesInterface iface); static boolean isVrf(InterfacesInterface iface); static boolean isInterface(InterfacesInterface iface); }
InterfaceConverter { @VisibleForTesting static Vrf convertVrf(InterfacesInterface iface) { checkArgument(isVrf(iface), "not a vrf"); Vrf vrf = new Vrf(iface.getName()); vrf.getAddresses().addAll(firstNonNull(iface.getAddresses(), ImmutableList.of())); return vrf; } InterfaceConverter(CumulusInterfacesConfiguration interfaces, Warnings w); Map<String, Bond> convertBonds(); @Nullable Bridge convertBridge(); Map<String, org.batfish.representation.cumulus.Interface> convertInterfaces(); Map<String, Vlan> convertVlans(); Map<String, Vrf> convertVrfs(); Map<String, Vxlan> convertVxlans(); @VisibleForTesting @Nullable static String getSuperInterfaceName(String ifaceName); @VisibleForTesting @Nullable static Integer getEncapsulationVlan(InterfacesInterface iface); static boolean isBond(InterfacesInterface iface); static boolean isVlan(InterfacesInterface iface); static boolean isVxlan(InterfacesInterface iface); static boolean isVrf(InterfacesInterface iface); static boolean isInterface(InterfacesInterface iface); @VisibleForTesting static final String BRIDGE_NAME; static final Set<String> DEFAULT_BRIDGE_PORTS; static final int DEFAULT_BRIDGE_PVID; }