}
private void createIdentityMocks() {
// identity
UserQuery sampleUserQuery = mock(UserQuery.class);
GroupQuery sampleGroupQuery = mock(GroupQuery.class);
List<User> mockUsers = new ArrayList<User>();
User mockUser = MockProvider.createMockUser();
mockUsers.add(mockUser);
// user query
when(sampleUserQuery.memberOfGroup(anyString())).thenReturn(sampleUserQuery);
when(sampleUserQuery.list()).thenReturn(mockUsers);
// group query
List<Group> mockGroups = MockProvider.createMockGroups();
when(sampleGroupQuery.groupMember(anyString())).thenReturn(sampleGroupQuery);
when(sampleGroupQuery.orderByGroupName()).thenReturn(sampleGroupQuery);
when(sampleGroupQuery.asc()).thenReturn(sampleGroupQuery);
when(sampleGroupQuery.list()).thenReturn(mockGroups);
when(mockIdentityService.createGroupQuery()).thenReturn(sampleGroupQuery);
when(mockIdentityService.createUserQuery()).thenReturn(sampleUserQuery);
}