@Test
public void testProcessExpiredPendingGroupMembers() {

    Map<String, List<DomainGroupMember>> memberList = new LinkedHashMap<>();
    DomainGroupMember domainGroupMember1 = new DomainGroupMember();
    domainGroupMember1.setMemberName("user.user1");
    List<GroupMember> memberGroups1 = new ArrayList<>();
    memberGroups1.add(new GroupMember().setGroupName("group1"));
    domainGroupMember1.setMemberGroups(memberGroups1);
    DomainGroupMember domainGroupMember2 = new DomainGroupMember();
    domainGroupMember2.setMemberName("user.user2");
    List<GroupMember> memberGroups2 = new ArrayList<>();
    memberGroups2.add(new GroupMember().setGroupName("group1"));
    domainGroupMember2.setMemberGroups(memberGroups2);
    List<DomainGroupMember> domainGroupMembers = new ArrayList<>();
    domainGroupMembers.add(domainGroupMember1);
    domainGroupMembers.add(domainGroupMember2);
    memberList.put("dom1", domainGroupMembers);
    ObjectStore saveStore = zms.dbService.store;
    zms.dbService.store = mockObjStore;
    Mockito.when(mockObjStore.getConnection(anyBoolean(), anyBoolean())).thenReturn(mockJdbcConn);
    Mockito.when(mockJdbcConn.getExpiredPendingDomainGroupMembers(30)).thenReturn(memberList);
    Mockito.when(mockJdbcConn.deletePendingRoleMember("dom1", "role1", "user.user1", "sys.auth.monitor",
            "Expired - auto reject")).thenReturn(true);
    Mockito.when(mockJdbcConn.deletePendingRoleMember("dom1", "role1", "user.user2", "sys.auth.monitor",
            "Expired - auto reject")).thenReturn(false);
    zms.dbService.processExpiredPendingMembers(30, "sys.auth.monitor");
    zms.dbService.store = saveStore;
}