@Test void apply() { List<UriFilterOption> applyFilters = new ArrayList<>(); applyFilters.add(fromString("/test/get/11")); applyFilters.add(fromString("/test/listtest3/*")); UrlResolver resolver = new UrlResolver("^(\\/payments\\/.*\\/).*$", applyFilters, ignoreFilters); assertThat(resolver.apply(mockGetUri("/test/get/11")), is(true)); assertThat(resolver.apply(mockGetUri("/test/list/students")), is(true)); assertThat(resolver.apply(mockGetUri("/test/list/teachers")), is(true)); assertThat(resolver.apply(mockGetUri("/test1/all")), is(true)); assertThat(resolver.apply(mockGetUri("/test/test1/all")), is(true)); assertThat(resolver.apply(mockGetUri("/test2/get/11")), is(false)); assertThat(resolver.apply(mockGetUri("/test2")), is(false)); assertThat(resolver.apply(mockGetUri("/test3/test")), is(false)); assertThat(resolver.apply(mockGetUri("/test3/pupils")), is(false)); assertThat(resolver.apply(mockGetUri("/another/url")), is(false)); assertThat(resolver.apply(mockGetUri("/payments/get/*")), is(true)); assertThat(resolver.apply(mockMethodAndUri(HttpMethod.POST,"/ota/post/*")), is(false)); resolver = new UrlResolver("", applyFilters, ignoreFilters); assertThat(resolver.apply(mockGetUri("/payments/get/*")), 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();  }