List of usage examples for org.springframework.security.core.authority.mapping SimpleAuthorityMapper setConvertToUpperCase
public void setConvertToUpperCase(boolean convertToUpperCase)
From source file:org.keycloak.adapters.springsecurity.support.KeycloakSpringAdapterUtilsTest.java
@Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); SimpleAuthorityMapper roleMapper = new SimpleAuthorityMapper(); roleMapper.setConvertToUpperCase(true); grantedAuthoritiesMapper = roleMapper; PowerMockito.mockStatic(AdapterUtils.class); when(AdapterUtils.getRolesFromSecurityContext(any(RefreshableKeycloakSecurityContext.class))) .thenReturn(AUTHORITIES);/*from w w w .j av a 2 s . co m*/ when(AdapterUtils.createPrincipal(eq(deployment), eq(context))).thenReturn(principal); }