@Test public void beanMethodMatchingWithOnlyMethodPaths() { TestBeanWithOnlyMethodPaths bean = new TestBeanWithOnlyMethodPaths(); BeanMethodMatcher matcher = new BeanMethodMatcher( OutlineBuilder.DEFAULT.wrap(bean), (request, method) -> method.invoke(bean)); ServerRequest request = mock(ServerRequest.class); when(request.method()).thenReturn(Method.POST); when(request.uri()).thenReturn("/abc"); assertEquals(null, matcher.applyIfMatches(request)); when(request.method()).thenReturn(Method.POST); when(request.uri()).thenReturn("/post"); assertEquals("POST", responseBodyAsString(matcher.applyIfMatches(request))); }
@Override public Observable<Response> applyIfMatches(ServerRequest request) { for (Matcher matcher : matchers) { Observable<Response> responseObservable = matcher.applyIfMatches(request); if (responseObservable != null) { return responseObservable; } } return null; }
BeanMethodMatcher implements Matcher { @Override public Observable<Response> applyIfMatches(ServerRequest request) { for (Matcher matcher : matchers) { Observable<Response> responseObservable = matcher.applyIfMatches(request); if (responseObservable != null) { return responseObservable; } } return null; } }
BeanMethodMatcher implements Matcher { @Override public Observable<Response> applyIfMatches(ServerRequest request) { for (Matcher matcher : matchers) { Observable<Response> responseObservable = matcher.applyIfMatches(request); if (responseObservable != null) { return responseObservable; } } return null; } BeanMethodMatcher(
            Bean<?> bean,
            BiFunction<ServerRequest, Method, Observable<Response>> route); }
BeanMethodMatcher implements Matcher { @Override public Observable<Response> applyIfMatches(ServerRequest request) { for (Matcher matcher : matchers) { Observable<Response> responseObservable = matcher.applyIfMatches(request); if (responseObservable != null) { return responseObservable; } } return null; } BeanMethodMatcher(
            Bean<?> bean,
            BiFunction<ServerRequest, Method, Observable<Response>> route); @Override Observable<Response> applyIfMatches(ServerRequest request); @Override Set<foundation.stack.datamill.http.Method> queryOptions(ServerRequest request); }
BeanMethodMatcher implements Matcher { @Override public Observable<Response> applyIfMatches(ServerRequest request) { for (Matcher matcher : matchers) { Observable<Response> responseObservable = matcher.applyIfMatches(request); if (responseObservable != null) { return responseObservable; } } return null; } BeanMethodMatcher(
            Bean<?> bean,
            BiFunction<ServerRequest, Method, Observable<Response>> route); @Override Observable<Response> applyIfMatches(ServerRequest request); @Override Set<foundation.stack.datamill.http.Method> queryOptions(ServerRequest request);  }