Search in sources :

Example 6 with ScopePermission

use of org.keycloak.testsuite.console.page.clients.authorization.permission.ScopePermission in project keycloak by keycloak.

the class ScopePermissionManagementTest method testUpdateWithoutResource.

@Test
public void testUpdateWithoutResource() {
    authorizationPage.navigateTo();
    ScopePermissionRepresentation expected = new ScopePermissionRepresentation();
    expected.setName("testUpdateWithoutResource Permission");
    expected.setDescription("description");
    expected.addResource("Resource A");
    expected.addScope("Scope A");
    expected.addPolicy("Policy C");
    expected = createPermission(expected);
    expected.getResources().clear();
    expected.addScope("Scope B");
    authorizationPage.navigateTo();
    authorizationPage.authorizationTabs().permissions().update(expected.getName(), expected);
    assertAlertSuccess();
    authorizationPage.navigateTo();
    ScopePermission actual = authorizationPage.authorizationTabs().permissions().name(expected.getName());
    assertPolicy(expected, actual);
}
Also used : ScopePermission(org.keycloak.testsuite.console.page.clients.authorization.permission.ScopePermission) ScopePermissionRepresentation(org.keycloak.representations.idm.authorization.ScopePermissionRepresentation) Test(org.junit.Test)

Aggregations

ScopePermission (org.keycloak.testsuite.console.page.clients.authorization.permission.ScopePermission)6 Test (org.junit.Test)5 ScopePermissionRepresentation (org.keycloak.representations.idm.authorization.ScopePermissionRepresentation)5 RolePolicyRepresentation (org.keycloak.representations.idm.authorization.RolePolicyRepresentation)1