use of org.keycloak.testsuite.updaters.UserAttributeUpdater in project keycloak by keycloak.
the class RoleMapperTest method singleRealmRoleWithDotsRemapped.
@Test
public void singleRealmRoleWithDotsRemapped() throws Exception {
pmu.add(createSamlProtocolMapper(RoleListMapper.PROVIDER_ID, AttributeStatementHelper.SAML_ATTRIBUTE_NAME, ROLE_ATTRIBUTE_NAME, AttributeStatementHelper.SAML_ATTRIBUTE_NAMEFORMAT, AttributeStatementHelper.BASIC, RoleListMapper.SINGLE_ROLE_ATTRIBUTE, "true"), createSamlProtocolMapper(RoleNameMapper.PROVIDER_ID, RoleNameMapper.ROLE_CONFIG, "role.with.dots", RoleNameMapper.NEW_ROLE_NAME, "blahWithDots")).update();
RoleRepresentation roleWithDots = realmsResouce().realm(REALM_NAME).roles().get("role.with.dots").toRepresentation();
try (UserAttributeUpdater uau = UserAttributeUpdater.forUserByUsername(adminClient, REALM_NAME, bburkeUser.getUsername()).update();
RoleScopeUpdater rsu = uau.realmRoleScope().removeByName("user").add(roleWithDots).update()) {
testExpectedRoles(SAML_CLIENT_ID_EMPLOYEE_2, "manager", "blahWithDots", "empl.oyee", "employee");
}
}
Aggregations