Add correct supports() method and tests.

This commit is contained in:
Ben Alex 2004-04-23 06:28:23 +00:00
parent ed68b701b2
commit d65b0e0bd2
2 changed files with 3 additions and 1 deletions

View File

@ -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;

View File

@ -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 ==========================================================