class SwaggerBasePathRewritingFilter extends SendResponseFilter {

    @Override
    public boolean shouldFilter() {
        return RequestContext.getCurrentContext().getRequest().getRequestURI().endsWith(Swagger2Controller.DEFAULT_URL);
    }

}

class SwaggerBasePathRewritingFilterTest {

    private SwaggerBasePathRewritingFilter filter;

    @Test
    public void shouldNotFilter_on_wrong_url() {


        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/management/info");
        RequestContext.getCurrentContext().setRequest(request);

        assertFalse(filter.shouldFilter());
    }

}