### Question:
DefaultPathRoleMatcher implements TreePathRoleMatcher { @Override public boolean isExcludedResource(Subject request) { checkComponentInit(); String exclude = excludeRoot.searchPathFilterRoles((String) request.getTargetResource()); return exclude != null && exclude.equals(EXCLUDE_ROLE); }  @Override void matchRole(Subject auToken); @Override void buildTree(); @Override void rebuildTree(); @Override boolean isExcludedResource(Subject request); void setPathTreeProvider(PathTreeProvider pathTreeProvider);  }### Answer:
@Test public void isExcludedResource() { loadExcludedResource(); HttpServletRequest request = createNiceMock(HttpServletRequest.class); expect(request.getRequestURI()).andReturn("/api/v2/detail"); expect(request.getMethod()).andReturn("put"); replay(request); Subject subject = NoneSubject.builder().setTargetUri(request.getRequestURI().concat("===") .concat(request.getMethod()).toLowerCase()).build(); assertTrue(pathRoleMatcher.isExcludedResource(subject)); verify(request); request = createNiceMock(HttpServletRequest.class); expect(request.getRequestURI()).andReturn("/book/v2/detail"); expect(request.getMethod()).andReturn("put"); replay(request); subject = NoneSubject.builder().setTargetUri(request.getRequestURI().concat("===") .concat(request.getMethod()).toLowerCase()).build(); assertFalse(pathRoleMatcher.isExcludedResource(subject)); verify(request); }