@Test
public void testGetGroups() {

    final String domainName = "get-groups";
    final String groupName1 = "group1";
    TopLevelDomain dom1 = createTopLevelDomainObject(domainName, "Test Domain1", "testOrg", adminUser);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    Group group1 = createGroupObject(domainName, groupName1, "user.joe", "user.jane");
    zms.putGroup(mockDomRsrcCtx, domainName, groupName1, auditRef, group1);
    Groups groupList = zms.getGroups(mockDomRsrcCtx, domainName, true);
    assertNotNull(groupList);
    assertEquals(groupList.getList().size(), 1);
    Group group = groupList.list.get(0);
    assertEquals(group.getName(), domainName + ":group.group1");
    assertEquals(group.getGroupMembers().size(), 2);
    List<String> checkList = new ArrayList<>();
    checkList.add("user.joe");
    checkList.add("user.jane");
    checkGroupMember(checkList, group.getGroupMembers());
    // get groups on unknown domain
    try {
        zms.getGroups(mockDomRsrcCtx, "unknown-domain", true);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), ResourceException.NOT_FOUND);
    }
    zms.deleteTopLevelDomain(mockDomRsrcCtx, domainName, auditRef);
}