KeycloakSpringAdapterUtils { public static OidcKeycloakAccount createAccount(KeycloakDeployment deployment, RefreshableKeycloakSecurityContext context) { Assert.notNull(context); Set<String> roles = AdapterUtils.getRolesFromSecurityContext(context); KeycloakPrincipal<RefreshableKeycloakSecurityContext> principal = AdapterUtils.createPrincipal(deployment, context); return new SimpleKeycloakAccount(principal, roles, context); } 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 testCreateAccount() throws Exception { OidcKeycloakAccount account = KeycloakSpringAdapterUtils.createAccount(deployment, context); assertNotNull(account); assertEquals(principal, account.getPrincipal()); assertEquals(context, account.getKeycloakSecurityContext()); assertEquals(AUTHORITIES, account.getRoles()); }