ConjunctionRequestFilter implements RequestFilter { @Override public boolean shouldSkip(HttpServletRequest request) { boolean result = true; for (int i = 0; result && i < requestFilters.length; i++) { result = requestFilters[i].shouldSkip(request); } return result; } ConjunctionRequestFilter(
      RequestFilter requestFilterA,
      RequestFilter requestFilterB,
      RequestFilter... anotherRequestFilters); @Override boolean shouldSkip(HttpServletRequest request);  }
@Test(dataProvider = "skip") public void testShouldSkip(String requestUri, String method) throws Exception { HttpServletRequest request = new MockHttpServletRequest("http: ConjunctionRequestFilter filter = new ConjunctionRequestFilter( new UriStartFromRequestFilter("/api/factory"), new NegationRequestFilter( new UriStartFromAndMethodRequestFilter("POST", "/api/factory"))); boolean result = filter.shouldSkip(request); Assert.assertTrue(result); }
@Test(dataProvider = "notskip") public void testShouldNotSkip(String requestUri, String method) throws Exception { HttpServletRequest request = new MockHttpServletRequest("http: ConjunctionRequestFilter filter = new ConjunctionRequestFilter( new UriStartFromRequestFilter("/api/factory"), new NegationRequestFilter( new UriStartFromAndMethodRequestFilter("POST", "/api/factory"))); boolean result = filter.shouldSkip(request); Assert.assertFalse(result); }