MembershipProvider extends AuthorizableBaseProvider { Set<String> removeMembers(@NotNull Tree groupTree, @NotNull Map<String, String> memberIds) { return writer.removeMembers(groupTree, memberIds); } MembershipProvider(@NotNull Root root, @NotNull ConfigurationParameters config);   }
@Test public void testRemoveMembers() throws Exception { Group gr = createGroup(); User member = createUser(); Group member2 = createGroup(); gr.addMembers(member.getID(), member2.getID()); Map<String, String> m = Maps.newHashMap(); m.put(getContentID(member.getID()), member.getID()); m.put(getContentID(member2.getID()), member2.getID()); Set<String> failed = mp.removeMembers(getTree(gr), m); assertTrue(failed.isEmpty()); }
@Test public void testRemoveNonMembers() throws Exception { Map<String, String> nonMemberIds = createIdMap(1, 5); Set<String> expected = Sets.newHashSet(nonMemberIds.values()); Set<String> failed = mp.removeMembers(getTree(createGroup()), nonMemberIds); assertEquals(expected, failed); }