@Test
public void testGetRoles() {

    String domainName = "getroles";
    TopLevelDomain dom1 = createTopLevelDomainObject(domainName,
            "Test Domain1", "testOrg", adminUser);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    Role role1 = createRoleObject(domainName, "Role1", null, "user.joe",
            "user.jane");
    zms.putRole(mockDomRsrcCtx, domainName, "Role1", auditRef, role1);
    Role role2 = createRoleObject(domainName, "Role2", null, "user.doe",
            "user.janie");
    zms.putRole(mockDomRsrcCtx, domainName, "Role2", auditRef, role2);
    Role role3 = createRoleObject(domainName, "Role3", "sys.auth", null, null);
    zms.putRole(mockDomRsrcCtx, domainName, "Role3", auditRef, role3);
    
    Roles roleList = zms.getRoles(mockDomRsrcCtx, domainName, Boolean.TRUE);
    List<Role> roles = roleList.getList();
    assertEquals(4, roles.size()); // need to account for admin role
    
    boolean role1Check = false;
    boolean role2Check = false;
    boolean role3Check = false;
    
    for (Role role : roles) {
        switch (role.getName()) {
            case "getroles:role.role1":
                List<String> checkList = new ArrayList<>();
                checkList.add("user.joe");
                checkList.add("user.jane");
                checkRoleMember(checkList, role.getRoleMembers());
                assertEquals(role.getRoleMembers().size(), 2);
                assertNull(role.getTrust());
                assertNotNull(role.getModified());
                role1Check = true;
                break;
            case "getroles:role.role2":
                List<String> checkList2 = new ArrayList<>();
                checkList2.add("user.doe");
                checkList2.add("user.janie");
                checkRoleMember(checkList2, role.getRoleMembers());
                assertEquals(role.getRoleMembers().size(), 2);
                assertNull(role.getTrust());
                assertNotNull(role.getModified());
                role2Check = true;
                break;
            case "getroles:role.role3":
                assertEquals(role.getTrust(), "sys.auth");
                assertNull(role.getRoleMembers());
                role3Check = true;
                assertNotNull(role.getModified());
                break;
        }
    }
    
    assertTrue(role1Check);
    assertTrue(role2Check);
    assertTrue(role3Check);
    zms.deleteTopLevelDomain(mockDomRsrcCtx, domainName, auditRef);
}