@Test public void testInterfaceDisplayString() { Configuration cfg = new Configuration("host", ConfigurationFormat.CISCO_IOS); Configuration cfgHuman = new Configuration("host", ConfigurationFormat.CISCO_IOS); cfgHuman.setHumanName("human"); Interface iface = Interface.builder().setName("iface").build(); assertThat(interfaceDisplayString(cfg, iface), equalTo("host[iface]")); assertThat(interfaceDisplayString(cfgHuman, iface), equalTo("host[iface] (human)")); }
@VisibleForTesting static String interfaceDisplayString(Configuration configuration, Interface iface) { String suffix = configuration.getHumanName() == null ? "" : String.format(" (%s)", configuration.getHumanName()); return String.format("%s[%s]%s", configuration.getHostname(), iface.getName(), suffix); }
CompletionMetadataUtils { @VisibleForTesting static String interfaceDisplayString(Configuration configuration, Interface iface) { String suffix = configuration.getHumanName() == null ? "" : String.format(" (%s)", configuration.getHumanName()); return String.format("%s[%s]%s", configuration.getHostname(), iface.getName(), suffix); } }
CompletionMetadataUtils { @VisibleForTesting static String interfaceDisplayString(Configuration configuration, Interface iface) { String suffix = configuration.getHumanName() == null ? "" : String.format(" (%s)", configuration.getHumanName()); return String.format("%s[%s]%s", configuration.getHostname(), iface.getName(), suffix); } private  CompletionMetadataUtils(); }
CompletionMetadataUtils { @VisibleForTesting static String interfaceDisplayString(Configuration configuration, Interface iface) { String suffix = configuration.getHumanName() == null ? "" : String.format(" (%s)", configuration.getHumanName()); return String.format("%s[%s]%s", configuration.getHostname(), iface.getName(), suffix); } private  CompletionMetadataUtils(); static Set<String> getFilterNames(Map<String, Configuration> configurations); static Set<NodeInterfacePair> getInterfaces(Map<String, Configuration> configurations); static Map<Ip, IpCompletionMetadata> getIps(Map<String, Configuration> configurations); static Set<String> getMlagIds(Map<String, Configuration> configurations); static Map<String, NodeCompletionMetadata> getNodes(
      Map<String, Configuration> configurations); static Set<String> getPrefixes(Map<String, Configuration> configurations); static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations); static Set<Location> getSourceLocationsWithSrcIps(
      Map<Location, LocationInfo> locationInfo); static Set<String> getStructureNames(Map<String, Configuration> configurations); static Set<String> getVrfs(Map<String, Configuration> configurations); static Set<String> getZones(Map<String, Configuration> configurations); }
CompletionMetadataUtils { @VisibleForTesting static String interfaceDisplayString(Configuration configuration, Interface iface) { String suffix = configuration.getHumanName() == null ? "" : String.format(" (%s)", configuration.getHumanName()); return String.format("%s[%s]%s", configuration.getHostname(), iface.getName(), suffix); } private  CompletionMetadataUtils(); static Set<String> getFilterNames(Map<String, Configuration> configurations); static Set<NodeInterfacePair> getInterfaces(Map<String, Configuration> configurations); static Map<Ip, IpCompletionMetadata> getIps(Map<String, Configuration> configurations); static Set<String> getMlagIds(Map<String, Configuration> configurations); static Map<String, NodeCompletionMetadata> getNodes(
      Map<String, Configuration> configurations); static Set<String> getPrefixes(Map<String, Configuration> configurations); static Set<String> getRoutingPolicyNames(Map<String, Configuration> configurations); static Set<Location> getSourceLocationsWithSrcIps(
      Map<Location, LocationInfo> locationInfo); static Set<String> getStructureNames(Map<String, Configuration> configurations); static Set<String> getVrfs(Map<String, Configuration> configurations); static Set<String> getZones(Map<String, Configuration> configurations); static Map<Ip, String> WELL_KNOWN_IPS; }