@Test void applyWithPriority() { List<UriFilterOption> applyFilters = new ArrayList<>(); applyFilters.add(fromString("/test1/*")); List<UriFilterOption> ignoreFilters = new ArrayList<>(); ignoreFilters.add(fromString("/test2/delete")); UrlResolver resolver = new UrlResolver("^\\/test2\\/.+$", applyFilters, ignoreFilters); assertThat(resolver.apply(mockMethodAndUri(HttpMethod.POST, "/test1/create")), is(true)); assertThat(resolver.apply(mockMethodAndUri(HttpMethod.DELETE, "/test1/delete")), is(true)); assertThat(resolver.apply(mockMethodAndUri(HttpMethod.POST,"/test2/create")), is(true)); assertThat(resolver.apply(mockMethodAndUri(HttpMethod.PUT,"/test2/update")), is(true)); assertThat(resolver.apply(mockMethodAndUri(HttpMethod.DELETE,"/test2/delete")), is(false)); }
public boolean apply(HttpRequest request) { String path = request.getURI().getPath(); String method = request.getMethod().name(); return apply(method, path); }
UrlResolver { public boolean apply(HttpRequest request) { String path = request.getURI().getPath(); String method = request.getMethod().name(); return apply(method, path); } }
UrlResolver { public boolean apply(HttpRequest request) { String path = request.getURI().getPath(); String method = request.getMethod().name(); return apply(method, path); } UrlResolver();  UrlResolver(String filterApplyUrlRegex, List<UriFilterOption> applyFilters, List<UriFilterOption> ignoreFilters); }
UrlResolver { public boolean apply(HttpRequest request) { String path = request.getURI().getPath(); String method = request.getMethod().name(); return apply(method, path); } UrlResolver();  UrlResolver(String filterApplyUrlRegex, List<UriFilterOption> applyFilters, List<UriFilterOption> ignoreFilters); boolean apply(HttpRequest request); boolean apply(String method, String path); boolean skip(HttpRequest request); @Deprecated void setFilterApplyUrlRegex(String filterApplyUrlRegex); void setFilterIgnoreUrls(List<UriFilterOption> filters); void setFilterApplyUrls(List<UriFilterOption> filters); boolean isEmpty(); @Override String toString(); }
UrlResolver { public boolean apply(HttpRequest request) { String path = request.getURI().getPath(); String method = request.getMethod().name(); return apply(method, path); } UrlResolver();  UrlResolver(String filterApplyUrlRegex, List<UriFilterOption> applyFilters, List<UriFilterOption> ignoreFilters); boolean apply(HttpRequest request); boolean apply(String method, String path); boolean skip(HttpRequest request); @Deprecated void setFilterApplyUrlRegex(String filterApplyUrlRegex); void setFilterIgnoreUrls(List<UriFilterOption> filters); void setFilterApplyUrls(List<UriFilterOption> filters); boolean isEmpty(); @Override String toString();  }