@Test
public void testPutRoleReview() {

    TopLevelDomain dom1 = createTopLevelDomainObject("role-review-dom",
            "Role review Test Domain1", "testOrg", "user.user1");
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    Role role1 = createRoleObject("role-review-dom", "role1", null,
            "user.john", "user.jane");
    zms.putRole(mockDomRsrcCtx, "role-review-dom", "role1", auditRef, role1);
    Timestamp tenDaysExpiry = Timestamp.fromMillis(System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(10, TimeUnit.DAYS));
    Timestamp sixtyDaysExpiry = Timestamp.fromMillis(System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(60, TimeUnit.DAYS));
    Timestamp fortyFiveDaysLowerBoundExpiry = Timestamp.fromMillis(System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(45, TimeUnit.DAYS));
    Membership mbr = generateMembership("role1", "user.doe", tenDaysExpiry);
    zms.putMembership(mockDomRsrcCtx, "role-review-dom", "role1", "user.doe", auditRef, mbr);
    RoleMeta rm = createRoleMetaObject(true);
    rm.setMemberExpiryDays(45);
    zms.putRoleMeta(mockDomRsrcCtx, "role-review-dom", "role1", auditRef, rm);
    Role inputRole = new Role().setName("role1");
    List<RoleMember> inputMembers = new ArrayList<>();
    inputRole.setRoleMembers(inputMembers);
    inputMembers.add(new RoleMember().setMemberName("user.john").setActive(false));
    inputMembers.add(new RoleMember().setMemberName("user.doe").setActive(true).setExpiration(sixtyDaysExpiry));
    zms.putRoleReview(mockDomRsrcCtx, "role-review-dom", "role1", auditRef, inputRole);
    Role resRole1 = zms.getRole(mockDomRsrcCtx, "role-review-dom", "role1", false, false, false);
    Timestamp fortyFiveDaysUpperBoundExpiry = Timestamp.fromMillis(System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(45, TimeUnit.DAYS) + TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES));
    int userChecked = 0;
    for (RoleMember roleMember : resRole1.getRoleMembers()) {
        if (roleMember.getMemberName().equals("user.jane") || roleMember.getMemberName().equals("user.doe")) {
            userChecked += 1;
            assertTrue(roleMember.getExpiration().toDate().after(fortyFiveDaysLowerBoundExpiry.toDate()) && roleMember.getExpiration().toDate().before(fortyFiveDaysUpperBoundExpiry.toDate()));
            assertTrue(roleMember.getApproved());
        }
    }
    assertEquals(userChecked, 2);
    zms.deleteTopLevelDomain(mockDomRsrcCtx, "role-review-dom", auditRef);
}