@Test public void testIsMember() throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException { AuthorizableWrapper authWrapper = new AuthorizableWrapperImpl(userResource); assertTrue(authWrapper.isMember("456")); authWrapper = new AuthorizableWrapperImpl(throwyResource); assertFalse(authWrapper.isMember("456")); }
@Override public boolean isMember(String groupName) { Iterable<Group> iterable = () -> getMembership(); return StreamSupport.stream(iterable.spliterator(), false).anyMatch(g -> { try { return groupName.equals(g.getID()); } catch (RepositoryException e) { log.error("Failed to get ID from authorizable: {}", g, e); return false; } }); }
AuthorizableWrapperImpl implements AuthorizableWrapper { @Override public boolean isMember(String groupName) { Iterable<Group> iterable = () -> getMembership(); return StreamSupport.stream(iterable.spliterator(), false).anyMatch(g -> { try { return groupName.equals(g.getID()); } catch (RepositoryException e) { log.error("Failed to get ID from authorizable: {}", g, e); return false; } }); } }
AuthorizableWrapperImpl implements AuthorizableWrapper { @Override public boolean isMember(String groupName) { Iterable<Group> iterable = () -> getMembership(); return StreamSupport.stream(iterable.spliterator(), false).anyMatch(g -> { try { return groupName.equals(g.getID()); } catch (RepositoryException e) { log.error("Failed to get ID from authorizable: {}", g, e); return false; } }); } AuthorizableWrapperImpl(ResourceResolver resolver);  AuthorizableWrapperImpl(Resource resource); }
AuthorizableWrapperImpl implements AuthorizableWrapper { @Override public boolean isMember(String groupName) { Iterable<Group> iterable = () -> getMembership(); return StreamSupport.stream(iterable.spliterator(), false).anyMatch(g -> { try { return groupName.equals(g.getID()); } catch (RepositoryException e) { log.error("Failed to get ID from authorizable: {}", g, e); return false; } }); } AuthorizableWrapperImpl(ResourceResolver resolver);  AuthorizableWrapperImpl(Resource resource); @Override Authorizable getAuthorizable(); @Override Iterator<Authorizable> getDeclaredMembers(); @Override Iterator<Group> getDeclaredMembership(); @Override Iterator<String> getGroupNames(); @Override String getId(); @Override Iterator<Authorizable> getMembers(); @Override Iterator<Group> getMembership(); @Override boolean isAdministrator(); @Override boolean isMember(String groupName); }
AuthorizableWrapperImpl implements AuthorizableWrapper { @Override public boolean isMember(String groupName) { Iterable<Group> iterable = () -> getMembership(); return StreamSupport.stream(iterable.spliterator(), false).anyMatch(g -> { try { return groupName.equals(g.getID()); } catch (RepositoryException e) { log.error("Failed to get ID from authorizable: {}", g, e); return false; } }); } AuthorizableWrapperImpl(ResourceResolver resolver);  AuthorizableWrapperImpl(Resource resource); @Override Authorizable getAuthorizable(); @Override Iterator<Authorizable> getDeclaredMembers(); @Override Iterator<Group> getDeclaredMembership(); @Override Iterator<String> getGroupNames(); @Override String getId(); @Override Iterator<Authorizable> getMembers(); @Override Iterator<Group> getMembership(); @Override boolean isAdministrator(); @Override boolean isMember(String groupName);  }