### Question:
AssetsFolderPropertiesSupport extends SlingSafeMethodsServlet implements Filter, SlingPostProcessor { @SuppressWarnings("squid:S3923") protected boolean accepts(SlingHttpServletRequest request) { if (!StringUtils.equalsIgnoreCase(POST_METHOD, request.getMethod())) { return false; } else if (!DAM_FOLDER_SHARE_OPERATION.equals(request.getParameter(OPERATION))) { return false; } else if (!StringUtils.startsWith(request.getResource().getPath(), DAM_PATH_PREFIX)) { return false; } else if (!request.getResource().isResourceType(JcrResourceConstants.NT_SLING_FOLDER) && !request.getResource().isResourceType(JcrResourceConstants.NT_SLING_ORDERED_FOLDER)) { return false; } return true; }  void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain); void init(FilterConfig filterConfig); void destroy(); void process(SlingHttpServletRequest request, List<Modification> changes);  }### Answer:
@Test public void accepts_slingFolder() throws Exception { request.setResource(slingFolderResource); assertTrue(assetsFolderPropertiesSupport.accepts(request)); }
@Test public void accepts_slingOrderedFolder() throws Exception { request.setResource(slingOrderedFolderResource); assertTrue(assetsFolderPropertiesSupport.accepts(request)); }
@Test public void accepts_rejects_method() throws Exception { request.setMethod("get"); assertFalse(assetsFolderPropertiesSupport.accepts(request)); }
@Test public void accepts_rejects_path() throws Exception { request.setResource(invalidPathResource); assertFalse(assetsFolderPropertiesSupport.accepts(request)); }
@Test public void accepts_rejects_resourceType() throws Exception { request.setResource(invalidResourceTypeResource); assertFalse(assetsFolderPropertiesSupport.accepts(request)); }
@Test public void accepts_rejects_operation() throws Exception { request.setParameterMap(ImmutableMap.<String, Object>builder().put(":operation", "not.dam.folder.share").build()); assertFalse(assetsFolderPropertiesSupport.accepts(request)); }