@Test
public void testPutGroupMeta() {

    final String domainName = "put-group-meta";
    final String groupName = "group1";
    TopLevelDomain dom1 = createTopLevelDomainObject(domainName, "Group Meta Test Domain1", "testOrg", adminUser);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    Group group1 = createGroupObject(domainName, groupName, "user.john", "user.jane");
    zms.putGroup(mockDomRsrcCtx, domainName, groupName, auditRef, group1);
    Authority savedAuthority = zms.userAuthority;
    Authority authority = Mockito.mock(Authority.class);
    Mockito.when(authority.getDateAttribute("user.john", "elevated-clearance")).thenReturn(new Date());
    Mockito.when(authority.isAttributeSet("user.john", "OnShore-US")).thenReturn(true);
    Mockito.when(authority.getDateAttribute("user.jane", "elevated-clearance")).thenReturn(new Date());
    Mockito.when(authority.isAttributeSet("user.jane", "OnShore-US")).thenReturn(true);
    Set<String> attrs = new HashSet<>();
    attrs.add("OnShore-US");
    attrs.add("elevated-clearance");
    Mockito.when(authority.booleanAttributesSupported()).thenReturn(attrs);
    Mockito.when(authority.dateAttributesSupported()).thenReturn(attrs);
    zms.userAuthority = authority;
    GroupMeta groupMeta = new GroupMeta();
    zms.putGroupMeta(mockDomRsrcCtx, domainName, groupName, auditRef, groupMeta);
    Group resGroup1 = zms.getGroup(mockDomRsrcCtx, domainName, groupName, true, false);
    assertNotNull(resGroup1);
    assertNull(resGroup1.getSelfServe());
    assertNull(resGroup1.getReviewEnabled());
    assertNull(resGroup1.getNotifyRoles());
    assertNull(resGroup1.getUserAuthorityExpiration());
    assertNull(resGroup1.getUserAuthorityFilter());
    groupMeta = new GroupMeta()
            .setSelfServe(true)
            .setNotifyRoles("role1")
            .setReviewEnabled(false)
            .setUserAuthorityExpiration("elevated-clearance")
            .setUserAuthorityFilter("OnShore-US");
    zms.putGroupMeta(mockDomRsrcCtx, domainName, groupName, auditRef, groupMeta);
    resGroup1 = zms.getGroup(mockDomRsrcCtx, domainName, groupName, true, false);
    assertNotNull(resGroup1);
    assertTrue(resGroup1.getSelfServe());
    assertNull(resGroup1.getReviewEnabled());
    assertEquals(resGroup1.getNotifyRoles(), "role1");
    assertEquals(resGroup1.getUserAuthorityExpiration(), "elevated-clearance");
    assertEquals(resGroup1.getUserAuthorityFilter(), "OnShore-US");
    groupMeta = new GroupMeta().setNotifyRoles("role2,role3");
    zms.putGroupMeta(mockDomRsrcCtx, domainName, groupName, auditRef, groupMeta);
    resGroup1 = zms.getGroup(mockDomRsrcCtx, domainName, groupName, true, false);
    assertNotNull(resGroup1);
    assertNull(resGroup1.getSelfServe()); // default value is false is not specified
    assertNull(resGroup1.getReviewEnabled());
    assertEquals(resGroup1.getNotifyRoles(), "role2,role3");
    assertEquals(resGroup1.getUserAuthorityExpiration(), "elevated-clearance");
    assertEquals(resGroup1.getUserAuthorityFilter(), "OnShore-US");
    zms.userAuthority = savedAuthority;
    zms.deleteTopLevelDomain(mockDomRsrcCtx, domainName, auditRef);
}