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) {
|
public boolean supports(Class authentication) {
|
||||||
if (UsernamePasswordAuthenticationToken.class.isAssignableFrom(
|
if (UsernamePasswordAuthenticationToken.class.isAssignableFrom(
|
||||||
authentication)) {
|
authentication)
|
||||||
|
|| (DaoAuthenticationToken.class.isAssignableFrom(authentication))) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -334,6 +334,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
|
||||||
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
|
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
|
||||||
assertTrue(provider.supports(UsernamePasswordAuthenticationToken.class));
|
assertTrue(provider.supports(UsernamePasswordAuthenticationToken.class));
|
||||||
assertTrue(!provider.supports(TestingAuthenticationToken.class));
|
assertTrue(!provider.supports(TestingAuthenticationToken.class));
|
||||||
|
assertTrue(provider.supports(DaoAuthenticationToken.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
//~ Inner Classes ==========================================================
|
//~ Inner Classes ==========================================================
|
||||||
|
|
Loading…
Reference in New Issue