DirectAccessGrantAuthenticationProvider implements AuthenticationProvider { @Override public boolean supports(Class<?> authentication) { return DirectAccessGrantToken.class.isAssignableFrom(authentication) || UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication); }  @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> authentication); @Required void setKeycloakDeployment(KeycloakDeployment keycloakDeployment); @Required void setDirectAccessGrantService(DirectAccessGrantService directAccessGrantService); void setGrantedAuthoritiesMapper(GrantedAuthoritiesMapper grantedAuthoritiesMapper);  }
@Test public void testSupports() throws Exception { assertTrue(directAccessGrantAuthenticationProvider.supports(DirectAccessGrantToken.class)); assertTrue(directAccessGrantAuthenticationProvider.supports(UsernamePasswordAuthenticationToken.class)); assertFalse(directAccessGrantAuthenticationProvider.supports(KeycloakAuthenticationToken.class)); }