### Question:
KeycloakAuthenticationProvider implements AuthenticationProvider { @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { KeycloakAuthenticationToken token = (KeycloakAuthenticationToken) authentication; List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>(); for (String role : token.getAccount().getRoles()) { grantedAuthorities.add(new KeycloakRole(role)); } return new KeycloakAuthenticationToken(token.getAccount(), token.isInteractive(), mapAuthorities(grantedAuthorities)); }  void setGrantedAuthoritiesMapper(GrantedAuthoritiesMapper grantedAuthoritiesMapper); @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> aClass);  }### Answer:
@Test public void testAuthenticate() throws Exception { assertAuthenticationResult(provider.authenticate(token)); }
@Test public void testAuthenticateInteractive() throws Exception { assertAuthenticationResult(provider.authenticate(interactiveToken)); }