@Test public void testWhenMethod() { final StreamingHttpService service = new HttpPredicateRouterBuilder() .whenMethod(POST).thenRouteTo(serviceA) .when((ctx, req) -> true).thenRouteTo(fallbackService) .buildStreaming(); when(request.method()).thenReturn(POST); assertSame(responseA, service.handle(ctx, request, reqRespFactory)); when(request.method()).thenReturn(GET); assertSame(fallbackResponse, service.handle(ctx, request, reqRespFactory)); }
@Override public RouteContinuation whenMethod(final HttpRequestMethod method) { andPredicate(method(method)); return continuation; }
HttpPredicateRouterBuilder implements RouteStarter { @Override public RouteContinuation whenMethod(final HttpRequestMethod method) { andPredicate(method(method)); return continuation; } }
HttpPredicateRouterBuilder implements RouteStarter { @Override public RouteContinuation whenMethod(final HttpRequestMethod method) { andPredicate(method(method)); return continuation; }  }
HttpPredicateRouterBuilder implements RouteStarter { @Override public RouteContinuation whenMethod(final HttpRequestMethod method) { andPredicate(method(method)); return continuation; }  @Override RouteContinuation whenMethod(final HttpRequestMethod method); @Override RouteContinuation whenMethodIsOneOf(final HttpRequestMethod... methods); @Override RouteContinuation whenPathEquals(final String path); @Override RouteContinuation whenPathIsOneOf(final String... paths); @Override RouteContinuation whenPathStartsWith(final String pathPrefix); @Override RouteContinuation whenPathMatches(final String pathRegex); @Override RouteContinuation whenPathMatches(final Pattern pathRegex); @Override StringMultiValueMatcher whenQueryParam(final String name); @Override StringMultiValueMatcher whenHeader(final CharSequence name); @Override CookieMatcher whenCookie(final String name); @Override RouteContinuation whenIsSsl(); @Override RouteContinuation whenIsNotSsl(); @Override RouteContinuation when(final Predicate<StreamingHttpRequest> predicate); @Override RouteContinuation when(final BiPredicate<ConnectionContext, StreamingHttpRequest> predicate); @Override StreamingHttpService buildStreaming(); }
HttpPredicateRouterBuilder implements RouteStarter { @Override public RouteContinuation whenMethod(final HttpRequestMethod method) { andPredicate(method(method)); return continuation; }  @Override RouteContinuation whenMethod(final HttpRequestMethod method); @Override RouteContinuation whenMethodIsOneOf(final HttpRequestMethod... methods); @Override RouteContinuation whenPathEquals(final String path); @Override RouteContinuation whenPathIsOneOf(final String... paths); @Override RouteContinuation whenPathStartsWith(final String pathPrefix); @Override RouteContinuation whenPathMatches(final String pathRegex); @Override RouteContinuation whenPathMatches(final Pattern pathRegex); @Override StringMultiValueMatcher whenQueryParam(final String name); @Override StringMultiValueMatcher whenHeader(final CharSequence name); @Override CookieMatcher whenCookie(final String name); @Override RouteContinuation whenIsSsl(); @Override RouteContinuation whenIsNotSsl(); @Override RouteContinuation when(final Predicate<StreamingHttpRequest> predicate); @Override RouteContinuation when(final BiPredicate<ConnectionContext, StreamingHttpRequest> predicate); @Override StreamingHttpService buildStreaming();  }