@Test
public void testProcessExpiredPendingMembers() {

    Map<String, List<DomainRoleMember>> memberList = new LinkedHashMap<>();
    DomainRoleMember domainRoleMember1 = new DomainRoleMember();
    domainRoleMember1.setMemberName("user.user1");
    List<MemberRole> memberRoles1 = new ArrayList<>();
    memberRoles1.add(new MemberRole().setRoleName("role1"));
    domainRoleMember1.setMemberRoles(memberRoles1);
    DomainRoleMember domainRoleMember2 = new DomainRoleMember();
    domainRoleMember2.setMemberName("user.user2");
    List<MemberRole> memberRoles2 = new ArrayList<>();
    memberRoles2.add(new MemberRole().setRoleName("role1"));
    domainRoleMember2.setMemberRoles(memberRoles2);
    List<DomainRoleMember> domainRoleMembers = new ArrayList<>();
    domainRoleMembers.add(domainRoleMember1);
    domainRoleMembers.add(domainRoleMember2);
    memberList.put("dom1", domainRoleMembers);
    ObjectStore saveStore = zms.dbService.store;
    zms.dbService.store = mockObjStore;
    Mockito.when(mockObjStore.getConnection(anyBoolean(), anyBoolean())).thenReturn(mockJdbcConn);
    Mockito.when(mockJdbcConn.getExpiredPendingDomainRoleMembers(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;
}