KeycloakSpringAdapterUtils { public static Collection<?extends GrantedAuthority> createGrantedAuthorities(RefreshableKeycloakSecurityContext context) { return createGrantedAuthorities(context, null); } private  KeycloakSpringAdapterUtils(); static OidcKeycloakAccount createAccount(KeycloakDeployment deployment, RefreshableKeycloakSecurityContext context); static Collection<?extends GrantedAuthority> createGrantedAuthorities(RefreshableKeycloakSecurityContext context); static Collection<? extends GrantedAuthority> createGrantedAuthorities(RefreshableKeycloakSecurityContext context, GrantedAuthoritiesMapper mapper); static RefreshableKeycloakSecurityContext createKeycloakSecurityContext(KeycloakDeployment deployment, AccessTokenResponse accessTokenResponse);  }
@Test public void testCreateGrantedAuthorities() throws Exception { Collection<? extends GrantedAuthority> authorities = KeycloakSpringAdapterUtils.createGrantedAuthorities(context); assertNotNull(authorities); assertTrue(authorities.containsAll(KEYCLOAK_ROLES)); }
@Test public void testCreateGrantedAuthoritiesWithMapper() throws Exception { Collection<? extends GrantedAuthority> authorities = KeycloakSpringAdapterUtils.createGrantedAuthorities(context, grantedAuthoritiesMapper); assertNotNull(authorities); assertEquals(Sets.newSet("ROLE_USER", "ROLE_ADMIN"), AuthorityUtils.authorityListToSet(authorities)); }