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);
|
user = getUserFromBackend(username);
|
||||||
} catch (BadCredentialsException ex) {
|
} catch (BadCredentialsException ex) {
|
||||||
if (this.context != null) {
|
if (this.context != null) {
|
||||||
|
if ((username == null) || "".equals(username)) {
|
||||||
|
username = "NONE_PROVIDED";
|
||||||
|
}
|
||||||
|
|
||||||
context.publishEvent(new AuthenticationFailureUsernameNotFoundEvent(
|
context.publishEvent(new AuthenticationFailureUsernameNotFoundEvent(
|
||||||
authentication,
|
authentication,
|
||||||
new User(username, "*****", false,
|
new User(username, "*****", false,
|
||||||
|
|
Loading…
Reference in New Issue