@@ -118,7 +118,6 @@ public void filterWhenAuthorizationManagerVerifyPassesThenNextFilter() throws Ex
118
118
@ Test
119
119
public void filterWhenAuthorizationManagerVerifyThrowsAccessDeniedExceptionThenStopFilterChain () {
120
120
AuthorizationManager <HttpServletRequest > mockAuthorizationManager = mock (AuthorizationManager .class );
121
- given (mockAuthorizationManager .authorize (any (), any ())).willCallRealMethod ();
122
121
AuthorizationFilter filter = new AuthorizationFilter (mockAuthorizationManager );
123
122
TestingAuthenticationToken authenticationToken = new TestingAuthenticationToken ("user" , "password" );
124
123
@@ -196,7 +195,6 @@ public void doFilterWhenAuthorizationEventPublisherThenUses() throws Exception {
196
195
@ Test
197
196
public void doFilterWhenErrorThenDoFilter () throws Exception {
198
197
AuthorizationManager <HttpServletRequest > authorizationManager = mock (AuthorizationManager .class );
199
- given (authorizationManager .authorize (any (), any ())).willCallRealMethod ();
200
198
AuthorizationFilter authorizationFilter = new AuthorizationFilter (authorizationManager );
201
199
MockHttpServletRequest mockRequest = new MockHttpServletRequest (null , "/path" );
202
200
mockRequest .setDispatcherType (DispatcherType .ERROR );
@@ -233,7 +231,6 @@ public void doFilterWhenObserveOncePerRequestTrueAndIsAppliedThenNotInvoked() th
233
231
234
232
@ Test
235
233
public void doFilterWhenObserveOncePerRequestTrueAndNotAppliedThenInvoked () throws ServletException , IOException {
236
- given (this .authorizationManager .authorize (any (), any ())).willCallRealMethod ();
237
234
this .filter .setObserveOncePerRequest (true );
238
235
this .filter .doFilter (this .request , this .response , this .chain );
239
236
verify (this .authorizationManager ).authorize (any (), any ());
@@ -242,15 +239,13 @@ public void doFilterWhenObserveOncePerRequestTrueAndNotAppliedThenInvoked() thro
242
239
@ Test
243
240
public void doFilterWhenObserveOncePerRequestFalseAndIsAppliedThenInvoked () throws ServletException , IOException {
244
241
setIsAppliedTrue ();
245
- given (this .authorizationManager .authorize (any (), any ())).willCallRealMethod ();
246
242
this .filter .setObserveOncePerRequest (false );
247
243
this .filter .doFilter (this .request , this .response , this .chain );
248
244
verify (this .authorizationManager ).authorize (any (), any ());
249
245
}
250
246
251
247
@ Test
252
248
public void doFilterWhenObserveOncePerRequestFalseAndNotAppliedThenInvoked () throws ServletException , IOException {
253
- given (this .authorizationManager .authorize (any (), any ())).willCallRealMethod ();
254
249
this .filter .setObserveOncePerRequest (false );
255
250
this .filter .doFilter (this .request , this .response , this .chain );
256
251
verify (this .authorizationManager ).authorize (any (), any ());
@@ -266,7 +261,6 @@ public void doFilterWhenFilterErrorDispatchFalseAndIsErrorThenNotInvoked() throw
266
261
267
262
@ Test
268
263
public void doFilterWhenFilterErrorDispatchTrueAndIsErrorThenInvoked () throws ServletException , IOException {
269
- given (this .authorizationManager .authorize (any (), any ())).willCallRealMethod ();
270
264
this .request .setDispatcherType (DispatcherType .ERROR );
271
265
this .filter .setFilterErrorDispatch (true );
272
266
this .filter .doFilter (this .request , this .response , this .chain );
@@ -290,7 +284,6 @@ public void doFilterWhenFilterThenRemoveAlreadyFilteredAttribute() throws Servle
290
284
291
285
@ Test
292
286
public void doFilterWhenFilterAsyncDispatchTrueAndIsAsyncThenInvoked () throws ServletException , IOException {
293
- given (this .authorizationManager .authorize (any (), any ())).willCallRealMethod ();
294
287
this .request .setDispatcherType (DispatcherType .ASYNC );
295
288
this .filter .setFilterAsyncDispatch (true );
296
289
this .filter .doFilter (this .request , this .response , this .chain );
0 commit comments