@Test
public void testUpdateRoleMetaFields() {

    Role role = new Role();
    RoleMeta meta = new RoleMeta().setSelfServe(true)
            .setReviewEnabled(true).setNotifyRoles("role1");
    zms.dbService.updateRoleMetaFields(role, meta);
    assertTrue(role.getSelfServe());
    assertTrue(role.getReviewEnabled());
    assertEquals(role.getNotifyRoles(), "role1");
    meta = new RoleMeta().setReviewEnabled(false);
    zms.dbService.updateRoleMetaFields(role, meta);
    assertTrue(role.getSelfServe());
    assertFalse(role.getReviewEnabled());
    assertEquals(role.getNotifyRoles(), "role1");
    meta = new RoleMeta().setNotifyRoles("role2");
    zms.dbService.updateRoleMetaFields(role, meta);
    assertTrue(role.getSelfServe());
    assertFalse(role.getReviewEnabled());
    assertEquals(role.getNotifyRoles(), "role2");
    meta = new RoleMeta().setUserAuthorityExpiration("expiry");
    zms.dbService.updateRoleMetaFields(role, meta);
    assertEquals(role.getNotifyRoles(), "role2");
    assertEquals(role.getUserAuthorityExpiration(), "expiry");
    meta = new RoleMeta().setUserAuthorityFilter("attr1");
    zms.dbService.updateRoleMetaFields(role, meta);
    assertEquals(role.getNotifyRoles(), "role2");
    assertEquals(role.getUserAuthorityExpiration(), "expiry");
    assertEquals(role.getUserAuthorityFilter(), "attr1");
}