@Test public void testThatFilterShouldBeAppliedBasedOnContext() { RequestContext ctx = RequestContext.getCurrentContext(); ctx.set("shouldDoAuth", false); assertFalse(authFilter.shouldFilter()); ctx.set("shouldDoAuth", true); assertTrue(authFilter.shouldFilter()); }
@Override public boolean shouldFilter() { return RequestContext.getCurrentContext().getBoolean(AUTH_BOOLEAN_FLAG_NAME); }
AuthFilter extends ZuulFilter { @Override public boolean shouldFilter() { return RequestContext.getCurrentContext().getBoolean(AUTH_BOOLEAN_FLAG_NAME); } }
AuthFilter extends ZuulFilter { @Override public boolean shouldFilter() { return RequestContext.getCurrentContext().getBoolean(AUTH_BOOLEAN_FLAG_NAME); } AuthFilter(ProxyRequestHelper helper, RestTemplate restTemplate, String authServiceHost, String authUri); }
AuthFilter extends ZuulFilter { @Override public boolean shouldFilter() { return RequestContext.getCurrentContext().getBoolean(AUTH_BOOLEAN_FLAG_NAME); } AuthFilter(ProxyRequestHelper helper, RestTemplate restTemplate, String authServiceHost, String authUri); @Override String filterType(); @Override int filterOrder(); @Override boolean shouldFilter(); @Override Object run(); }
AuthFilter extends ZuulFilter { @Override public boolean shouldFilter() { return RequestContext.getCurrentContext().getBoolean(AUTH_BOOLEAN_FLAG_NAME); } AuthFilter(ProxyRequestHelper helper, RestTemplate restTemplate, String authServiceHost, String authUri); @Override String filterType(); @Override int filterOrder(); @Override boolean shouldFilter(); @Override Object run();  }