@Test public void shouldNotFilter_on_wrong_url() { MockHttpServletRequest request = new MockHttpServletRequest("GET", "/management/info"); RequestContext.getCurrentContext().setRequest(request); assertFalse(filter.shouldFilter()); }
@Test public void shouldFilter_on_default_swagger_url() { MockHttpServletRequest request = new MockHttpServletRequest("GET", DEFAULT_URL); RequestContext.getCurrentContext().setRequest(request); assertTrue(filter.shouldFilter()); }
/** Zuul DebugFilter can be triggered by "deug" parameter. */ @Test public void shouldFilter_on_default_swagger_url_with_param() { MockHttpServletRequest request = new MockHttpServletRequest("GET", DEFAULT_URL); request.setParameter("debug", "true"); RequestContext.getCurrentContext().setRequest(request); assertTrue(filter.shouldFilter()); }