@@ -31,7 +31,7 @@ class AuthenticationEventListenerTest {
3131 private LoginAttemptService loginAttemptService ;
3232
3333 @ InjectMocks
34- private AuthenticationEventLIstener authenticationEventListener ;
34+ private AuthenticationEventListener authenticationEventListener ;
3535
3636 private Authentication authentication ;
3737 private String username ;
@@ -99,8 +99,7 @@ class FailureEventTests {
9999 void onFailure_handlesBadCredentials () {
100100 // Given
101101 BadCredentialsException exception = new BadCredentialsException ("Bad credentials" );
102- AbstractAuthenticationFailureEvent event = new AuthenticationFailureBadCredentialsEvent (
103- authentication , exception );
102+ AbstractAuthenticationFailureEvent event = new AuthenticationFailureBadCredentialsEvent (authentication , exception );
104103
105104 // When
106105 authenticationEventListener .onFailure (event );
@@ -114,8 +113,7 @@ void onFailure_handlesBadCredentials() {
114113 void onFailure_handlesAccountDisabled () {
115114 // Given
116115 DisabledException exception = new DisabledException ("Account disabled" );
117- AbstractAuthenticationFailureEvent event = new AuthenticationFailureDisabledEvent (
118- authentication , exception );
116+ AbstractAuthenticationFailureEvent event = new AuthenticationFailureDisabledEvent (authentication , exception );
119117
120118 // When
121119 authenticationEventListener .onFailure (event );
@@ -129,8 +127,7 @@ void onFailure_handlesAccountDisabled() {
129127 void onFailure_handlesAccountLocked () {
130128 // Given
131129 LockedException exception = new LockedException ("Account locked" );
132- AbstractAuthenticationFailureEvent event = new AuthenticationFailureLockedEvent (
133- authentication , exception );
130+ AbstractAuthenticationFailureEvent event = new AuthenticationFailureLockedEvent (authentication , exception );
134131
135132 // When
136133 authenticationEventListener .onFailure (event );
@@ -146,8 +143,7 @@ void onFailure_handlesNullAuthenticationName() {
146143 Authentication nullAuth = mock (Authentication .class );
147144 when (nullAuth .getName ()).thenReturn (null );
148145 BadCredentialsException exception = new BadCredentialsException ("Bad credentials" );
149- AbstractAuthenticationFailureEvent event = new AuthenticationFailureBadCredentialsEvent (
150- nullAuth , exception );
146+ AbstractAuthenticationFailureEvent event = new AuthenticationFailureBadCredentialsEvent (nullAuth , exception );
151147
152148 // When
153149 authenticationEventListener .onFailure (event );
@@ -182,8 +178,7 @@ void mixedSuccessAndFailureEvents() {
182178 // Given
183179 AuthenticationSuccessEvent successEvent = new AuthenticationSuccessEvent (authentication );
184180 BadCredentialsException exception = new BadCredentialsException ("Bad credentials" );
185- AbstractAuthenticationFailureEvent failureEvent = new AuthenticationFailureBadCredentialsEvent (
186- authentication , exception );
181+ AbstractAuthenticationFailureEvent failureEvent = new AuthenticationFailureBadCredentialsEvent (authentication , exception );
187182
188183 // When
189184 authenticationEventListener .onFailure (failureEvent );
@@ -200,14 +195,13 @@ void events_differentUsers() {
200195 // Given
201196 String user1 = "user1@example.com" ;
202197 String user2 = "user2@example.com" ;
203-
198+
204199 Authentication auth1 = new UsernamePasswordAuthenticationToken (user1 , "password" );
205200 Authentication auth2 = new UsernamePasswordAuthenticationToken (user2 , "password" );
206-
201+
207202 AuthenticationSuccessEvent successEvent1 = new AuthenticationSuccessEvent (auth1 );
208203 BadCredentialsException exception = new BadCredentialsException ("Bad credentials" );
209- AbstractAuthenticationFailureEvent failureEvent2 = new AuthenticationFailureBadCredentialsEvent (
210- auth2 , exception );
204+ AbstractAuthenticationFailureEvent failureEvent2 = new AuthenticationFailureBadCredentialsEvent (auth2 , exception );
211205
212206 // When
213207 authenticationEventListener .onSuccess (successEvent1 );
@@ -218,4 +212,4 @@ void events_differentUsers() {
218212 verify (loginAttemptService ).loginFailed (user2 );
219213 }
220214 }
221- }
215+ }
0 commit comments