@Test(dataProvider = "delegatedRoles")
public void testValidateRoleStructure(String domainName, Role role, boolean expectedFailure) {

    final String trustDomainName = "trust";
    TopLevelDomain dom1 = createTopLevelDomainObject(trustDomainName,
            "Test Domain1", "testOrg", "user.user1");
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    try {
        zms.validateRoleStructure(role, domainName, "unittest");
        if (expectedFailure) {
            fail();
        }
    } catch (ResourceException e) {
        if (expectedFailure) {
            assertEquals(e.getCode(), 400);
        } else {
            fail("should not have failed with ResourceException");
        }
    }
    zms.deleteTopLevelDomain(mockDomRsrcCtx, trustDomainName, auditRef);
}