Conditions { public static <T extends HttpRequest> Predicate<T> requestTo(final String pattern) { final Predicate<String> predicate = Glob.compile(pattern); return pattern.startsWith("/") ? requestTo(HttpRequest::getPath, predicate) : requestTo(request -> reconstruct(request, SCHEME, AUTHORITY, PATH), predicate); } private  Conditions(); @SafeVarargs static Predicate<T> exclude(final Predicate<T>... predicates); static Predicate<T> exclude(final Collection<Predicate<T>> predicates); static Predicate<T> requestTo(final String pattern); static Predicate<T> contentType(final String contentType,
            final String... contentTypes); static Predicate<T> withoutContentType(); static Predicate<T> header(final String key, final String value); static Predicate<T> header(final String key, final Predicate<String> predicate); static Predicate<T> header(final BiPredicate<String, String> predicate);  }
@Test void requestToShouldMatchURI() { final Predicate<HttpRequest> unit = requestTo("http: assertThat(unit.test(request), is(true)); }
@Test void requestToShouldNotMatchURIPattern() { final Predicate<HttpRequest> unit = requestTo("http: assertThat(unit.test(request), is(false)); }
@Test void requestToShouldIgnoreQueryParameters() { final Predicate<HttpRequest> unit = requestTo("http: final MockHttpRequest request = MockHttpRequest.create() .withQuery("location=/bar"); assertThat(unit.test(request), is(true)); }
@Test void requestToShouldMatchPath() { final Predicate<HttpRequest> unit = requestTo("/"); assertThat(unit.test(request), is(true)); }