use of org.keycloak.testsuite.console.page.clients.authorization.resource.Resource in project keycloak by keycloak.
the class ResourceManagementTest method testUpdate.
@Test
public void testUpdate() {
ResourceRepresentation expected = createResource();
String previousName = expected.getName();
expected.setName("changed");
expected.setDisplayName("changed");
expected.setType("changed");
expected.setUri("changed");
expected.setScopes(Arrays.asList("Scope A", "Scope B", "Scope C").stream().map(name -> new ScopeRepresentation(name)).collect(Collectors.toSet()));
authorizationPage.navigateTo();
Resource resource = authorizationPage.authorizationTabs().resources().name(previousName);
resource.update(expected);
assertAlertSuccess();
assertResource(expected);
expected.setScopes(expected.getScopes().stream().filter(scope -> scope.getName().equals("Scope C")).collect(Collectors.toSet()));
authorizationPage.navigateTo();
authorizationPage.authorizationTabs().resources().update(expected.getName(), expected);
assertAlertSuccess();
assertResource(expected);
}
Aggregations