@Test(dataProvider = "skip") public void testShouldNotSkip(String requestUri) throws Exception { HttpServletRequest request = new MockHttpServletRequest("http: PathSegmentNumberFilter filter = new PathSegmentNumberFilter(2); boolean result = filter.shouldSkip(request); Assert.assertFalse(result); }
@Override public boolean shouldSkip(HttpServletRequest request) { List<PathSegment> pathSegments = UriComponent.parsePathSegments(request.getRequestURI(), false); int notEmptyPathSergments = 0; for (PathSegment pathSegment : pathSegments) { if (pathSegment.getPath() != null && !pathSegment.getPath().isEmpty()) { notEmptyPathSergments++; } } return notEmptyPathSergments == segmentNumber; }
PathSegmentNumberFilter implements RequestFilter { @Override public boolean shouldSkip(HttpServletRequest request) { List<PathSegment> pathSegments = UriComponent.parsePathSegments(request.getRequestURI(), false); int notEmptyPathSergments = 0; for (PathSegment pathSegment : pathSegments) { if (pathSegment.getPath() != null && !pathSegment.getPath().isEmpty()) { notEmptyPathSergments++; } } return notEmptyPathSergments == segmentNumber; } }
PathSegmentNumberFilter implements RequestFilter { @Override public boolean shouldSkip(HttpServletRequest request) { List<PathSegment> pathSegments = UriComponent.parsePathSegments(request.getRequestURI(), false); int notEmptyPathSergments = 0; for (PathSegment pathSegment : pathSegments) { if (pathSegment.getPath() != null && !pathSegment.getPath().isEmpty()) { notEmptyPathSergments++; } } return notEmptyPathSergments == segmentNumber; } PathSegmentNumberFilter(int segmentNumber); }
PathSegmentNumberFilter implements RequestFilter { @Override public boolean shouldSkip(HttpServletRequest request) { List<PathSegment> pathSegments = UriComponent.parsePathSegments(request.getRequestURI(), false); int notEmptyPathSergments = 0; for (PathSegment pathSegment : pathSegments) { if (pathSegment.getPath() != null && !pathSegment.getPath().isEmpty()) { notEmptyPathSergments++; } } return notEmptyPathSergments == segmentNumber; } PathSegmentNumberFilter(int segmentNumber); @Override boolean shouldSkip(HttpServletRequest request); }
PathSegmentNumberFilter implements RequestFilter { @Override public boolean shouldSkip(HttpServletRequest request) { List<PathSegment> pathSegments = UriComponent.parsePathSegments(request.getRequestURI(), false); int notEmptyPathSergments = 0; for (PathSegment pathSegment : pathSegments) { if (pathSegment.getPath() != null && !pathSegment.getPath().isEmpty()) { notEmptyPathSergments++; } } return notEmptyPathSergments == segmentNumber; } PathSegmentNumberFilter(int segmentNumber); @Override boolean shouldSkip(HttpServletRequest request);  }