@Test public void shouldNotFilterNonStRequests() throws Exception { EndpointEnhancingRequestFilter filter = new EndpointEnhancingRequestFilter(); Provider<Ref<ConnectionContext>> ctxRefProvider = () -> Refs.of(null); Provider<RouteStrategiesConfig> routeStrategiesConfigProvider = () -> mock(RouteStrategiesConfig.class); RequestScope requestScope = mock(RequestScope.class); setField(filter, filter.getClass().getDeclaredField("ctxRefProvider"), ctxRefProvider); setField(filter, filter.getClass().getDeclaredField("routeStrategiesConfigProvider"), routeStrategiesConfigProvider); setField(filter, filter.getClass().getDeclaredField("requestScope"), requestScope); ContainerRequestContext context = mock(ContainerRequestContext.class); filter.filter(mock(ContainerRequestContext.class)); verifyZeroInteractions(context); }
@Override public void filter(final ContainerRequestContext requestCtx) { if (ctxRefProvider.get().get() != null) { enhancedEndpointCache.enhance(requestScope, ctxRefProvider, routeStrategiesConfigProvider, (UriRoutingContext) requestCtx.getUriInfo()); } }
EndpointEnhancingRequestFilter implements ContainerRequestFilter { @Override public void filter(final ContainerRequestContext requestCtx) { if (ctxRefProvider.get().get() != null) { enhancedEndpointCache.enhance(requestScope, ctxRefProvider, routeStrategiesConfigProvider, (UriRoutingContext) requestCtx.getUriInfo()); } } }
EndpointEnhancingRequestFilter implements ContainerRequestFilter { @Override public void filter(final ContainerRequestContext requestCtx) { if (ctxRefProvider.get().get() != null) { enhancedEndpointCache.enhance(requestScope, ctxRefProvider, routeStrategiesConfigProvider, (UriRoutingContext) requestCtx.getUriInfo()); } }  }
EndpointEnhancingRequestFilter implements ContainerRequestFilter { @Override public void filter(final ContainerRequestContext requestCtx) { if (ctxRefProvider.get().get() != null) { enhancedEndpointCache.enhance(requestScope, ctxRefProvider, routeStrategiesConfigProvider, (UriRoutingContext) requestCtx.getUriInfo()); } }  @Override void filter(final ContainerRequestContext requestCtx); }
EndpointEnhancingRequestFilter implements ContainerRequestFilter { @Override public void filter(final ContainerRequestContext requestCtx) { if (ctxRefProvider.get().get() != null) { enhancedEndpointCache.enhance(requestScope, ctxRefProvider, routeStrategiesConfigProvider, (UriRoutingContext) requestCtx.getUriInfo()); } }  @Override void filter(final ContainerRequestContext requestCtx);  }