KEYCLOAK-8791 Fix AggregatePolicyManagementTest Admin Console UI test

This commit is contained in:
vmuzikar 2018-11-12 12:29:20 +01:00 committed by Pavel Drozd
parent 602a6e201d
commit 5b72bd8da6

View file

@ -32,6 +32,7 @@ import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.RolePoliciesResource;
import org.keycloak.admin.client.resource.RolesResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.common.Profile;
import org.keycloak.common.Version;
import org.keycloak.representations.idm.RoleRepresentation;
import org.keycloak.representations.idm.authorization.AggregatePolicyRepresentation;
@ -231,19 +232,21 @@ public class AggregatePolicyManagementTest extends AbstractAuthorizationSettings
policy.createPolicy(childTimePolicy);
expected.addPolicy(childTimePolicy.getName());
RulePolicyRepresentation rulePolicy = new RulePolicyRepresentation();
if (Profile.isFeatureEnabled(Profile.Feature.AUTHZ_DROOLS_POLICY)) {
RulePolicyRepresentation rulePolicy = new RulePolicyRepresentation();
rulePolicy.setName(UUID.randomUUID().toString());
rulePolicy.setDescription("description");
rulePolicy.setArtifactGroupId("org.keycloak.testsuite");
rulePolicy.setArtifactId("photoz-authz-policy");
rulePolicy.setArtifactVersion(Version.VERSION);
rulePolicy.setModuleName("PhotozAuthzOwnerPolicy");
rulePolicy.setSessionName("MainOwnerSession");
rulePolicy.setScannerPeriod("1");
rulePolicy.setScannerPeriodUnit("Minutes");
policy.createPolicy(rulePolicy);
expected.addPolicy(rulePolicy.getName());
rulePolicy.setName(UUID.randomUUID().toString());
rulePolicy.setDescription("description");
rulePolicy.setArtifactGroupId("org.keycloak.testsuite");
rulePolicy.setArtifactId("photoz-authz-policy");
rulePolicy.setArtifactVersion(Version.VERSION);
rulePolicy.setModuleName("PhotozAuthzOwnerPolicy");
rulePolicy.setSessionName("MainOwnerSession");
rulePolicy.setScannerPeriod("1");
rulePolicy.setScannerPeriodUnit("Minutes");
policy.createPolicy(rulePolicy);
expected.addPolicy(rulePolicy.getName());
}
GroupPolicyRepresentation childGroupPolicy = new GroupPolicyRepresentation();