use of org.keycloak.testsuite.console.page.clients.authorization.policy.JSPolicy in project keycloak by keycloak.
the class JSPolicyManagementTest method testUpdate.
@Test
public void testUpdate() throws InterruptedException {
authorizationPage.navigateTo();
JSPolicyRepresentation expected = new JSPolicyRepresentation();
expected.setName("Test JS Policy");
expected.setDescription("description");
expected.setCode("$evaluation.grant();");
expected = createPolicy(expected);
String previousName = expected.getName();
expected.setName("Changed Test JS Policy");
expected.setDescription("Changed description");
expected.setLogic(Logic.NEGATIVE);
expected.setCode("$evaluation.deny();");
authorizationPage.navigateTo();
authorizationPage.authorizationTabs().policies().update(previousName, expected);
assertAlertSuccess();
authorizationPage.navigateTo();
JSPolicy actual = authorizationPage.authorizationTabs().policies().name(expected.getName());
assertPolicy(expected, actual);
}
use of org.keycloak.testsuite.console.page.clients.authorization.policy.JSPolicy in project keycloak by keycloak.
the class JSPolicyManagementTest method createPolicy.
private JSPolicyRepresentation createPolicy(JSPolicyRepresentation expected) {
JSPolicy policy = authorizationPage.authorizationTabs().policies().create(expected);
assertAlertSuccess();
return assertPolicy(expected, policy);
}
Aggregations