Mockito.when(accessControlEntry.getPermission()).thenReturn(permission);
return accessControlEntry;
}
private GroupAce createGroupAce(BranchPermission permission, boolean isGranted) {
GroupAce groupAce = Mockito.mock(GroupAce.class);
Group group = Mockito.mock(Group.class);
List<User> users = new ArrayList<>();
users.add(user);
Mockito.when(group.getUsers()).thenReturn(users);
Mockito.when(groupAce.getGroup(groupDao)).thenReturn(group);
Mockito.when(groupAce.isGranting()).thenReturn(isGranted);
Mockito.when(groupAce.getPermission()).thenReturn(permission);
return groupAce;
}