Fix unit test compatibility if no username provided.

This commit is contained in:
Ben Alex 2004-08-12 01:25:53 +00:00
parent da5469fed0
commit 08ee5deaa9
1 changed files with 4 additions and 0 deletions

View File

@ -197,6 +197,10 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
user = getUserFromBackend(username);
} catch (BadCredentialsException ex) {
if (this.context != null) {
if ((username == null) || "".equals(username)) {
username = "NONE_PROVIDED";
}
context.publishEvent(new AuthenticationFailureUsernameNotFoundEvent(
authentication,
new User(username, "*****", false,