RequestMethodFilter implements RequestFilter { @Override public boolean shouldSkip(HttpServletRequest request) { return requestMethod.equals(request.getMethod()); } RequestMethodFilter(String requestMethod); @Override boolean shouldSkip(HttpServletRequest request);  }
@Test(dataProvider = "skip") public void testShouldSkip(String requestUri, String method) throws Exception { HttpServletRequest request = new MockHttpServletRequest("http: RequestMethodFilter filter = new RequestMethodFilter("GET"); 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: RequestMethodFilter filter = new RequestMethodFilter("POST"); boolean result = filter.shouldSkip(request); Assert.assertFalse(result); }