Fix unit test compatibility if no username provided.
This commit is contained in:
parent
da5469fed0
commit
08ee5deaa9
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue