@Test
public void testAddDefaultAdminMembers() {

    final String domainName = "add-default-domain-admins";
    TopLevelDomain dom1 = createTopLevelDomainObject(domainName,
            "Test Domain1", "testOrg", adminUser);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    Role adminRole = zms.getRole(mockDomRsrcCtx, domainName, "admin", false, false, false);
    assertEquals(adminRole.getRoleMembers().size(), 1);
    List<String> admins = new ArrayList<>();
    admins.add(adminUser);
    admins.add("user.default");
    DefaultAdmins addDefaultAdmins = new DefaultAdmins().setAdmins(admins);
    zms.addDefaultAdminMembers(mockDomRsrcCtx, domainName, adminRole, addDefaultAdmins, auditRef, "unittest");
    adminRole = zms.getRole(mockDomRsrcCtx, domainName, "admin", false, false, false);
    assertEquals(adminRole.getRoleMembers().size(), 2);
    boolean newAdminFound = false;
    for (RoleMember roleMember : adminRole.getRoleMembers()) {
        if (roleMember.getMemberName().equals("user.default")) {
            newAdminFound = true;
            break;
        }
    }
    assertTrue(newAdminFound);
    // now let's delete the default admin user
    admins = new ArrayList<>();
    admins.add("user.default");
    admins.add("user.unknown");
    DefaultAdmins deleteDefaultAdmins = new DefaultAdmins().setAdmins(admins);
    zms.removeAdminMembers(mockDomRsrcCtx, domainName, Collections.singletonList(adminRole),
            adminRole.getName(), deleteDefaultAdmins, auditRef, "unittest");
    // verify we're back to a single admin role member
    adminRole = zms.getRole(mockDomRsrcCtx, domainName, "admin", false, false, false);
    assertEquals(adminRole.getRoleMembers().size(), 1);
    assertEquals(adminRole.getRoleMembers().get(0).getMemberName(), adminUser);
    zms.deleteTopLevelDomain(mockDomRsrcCtx, domainName, auditRef);
}