Add correct supports() method and tests.
This commit is contained in:
parent
ed68b701b2
commit
d65b0e0bd2
|
@ -203,7 +203,8 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
|
|||
|
||||
public boolean supports(Class authentication) {
|
||||
if (UsernamePasswordAuthenticationToken.class.isAssignableFrom(
|
||||
authentication)) {
|
||||
authentication)
|
||||
|| (DaoAuthenticationToken.class.isAssignableFrom(authentication))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -334,6 +334,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
|
|||
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
|
||||
assertTrue(provider.supports(UsernamePasswordAuthenticationToken.class));
|
||||
assertTrue(!provider.supports(TestingAuthenticationToken.class));
|
||||
assertTrue(provider.supports(DaoAuthenticationToken.class));
|
||||
}
|
||||
|
||||
//~ Inner Classes ==========================================================
|
||||
|
|
Loading…
Reference in New Issue