@Override LocationSpecifier buildLocationSpecifier(Pattern pattern) { return new NameRegexInterfaceLinkLocationSpecifier(pattern); } }
@Test public void testSourceInterfaceParameter() { SearchFiltersParameters params = _allLocationsParams .toBuilder() .setStartLocationSpecifier(new NameRegexInterfaceLinkLocationSpecifier(IFACE1)) .build(); // can match line 1 because IFACE1 is specified Optional<SearchFiltersResult> result = _batfish.reachFilter(_config, toMatchLineAcl(1, SRC_ACL), params); assertThat(result.get().getExampleFlow(), allOf(hasIngressInterface(IFACE1), hasDstIp(IP1))); // cannot match line 2 because IFACE2 is not specified result = _batfish.reachFilter(_config, toMatchLineAcl(2, SRC_ACL), params); assertThat("Should not find a result", !result.isPresent()); }