use of org.keycloak.testsuite.console.page.clients.authorization.policy.Policies in project keycloak by keycloak.
the class DefaultAuthorizationSettingsTest method assertDefaultSettings.
private void assertDefaultSettings() {
AuthorizationSettingsForm settings = authorizationPage.settings();
assertEquals(PolicyEnforcerConfig.EnforcementMode.ENFORCING, settings.getEnforcementMode());
assertEquals(true, settings.isAllowRemoteResourceManagement());
assertEquals(DecisionStrategy.UNANIMOUS, settings.getDecisionStrategy());
assertEquals(true, settings.isAllowRemoteResourceManagement());
Resources resources = authorizationPage.authorizationTabs().resources();
ResourceRepresentation resource = resources.resources().findByName("Default Resource");
assertNotNull(resource);
assertEquals("urn:oidc-confidetial:resources:default", resource.getType());
assertEquals("/*", resource.getUri());
assertEquals(newClient.getClientId(), resource.getOwner().getName());
Scopes scopes = authorizationPage.authorizationTabs().scopes();
assertTrue(scopes.scopes().getTableRows().isEmpty());
Permissions permissions = authorizationPage.authorizationTabs().permissions();
PolicyRepresentation permission = permissions.permissions().findByName("Default Permission");
assertNotNull(permission);
assertEquals("resource", permission.getType());
Policies policies = authorizationPage.authorizationTabs().policies();
PolicyRepresentation policy = policies.policies().findByName("Default Policy");
assertNotNull(policy);
assertEquals("js", policy.getType());
}
Aggregations