From 1e840cc854e3a22d70513903d993df16ad4f38be Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 4 Aug 2020 00:23:01 -0700 Subject: [PATCH] Move @Mock annotations Update a couple of tests to use the more traditional `@Mock` annotation placement. Issue gh-8945 --- .../aspect/AnnotationSecurityAspectTests.java | 3 ++- .../AspectJMethodSecurityInterceptorTests.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/aspects/src/test/java/org/springframework/security/access/intercept/aspectj/aspect/AnnotationSecurityAspectTests.java b/aspects/src/test/java/org/springframework/security/access/intercept/aspectj/aspect/AnnotationSecurityAspectTests.java index 9c0923a18a..4296c72cec 100644 --- a/aspects/src/test/java/org/springframework/security/access/intercept/aspectj/aspect/AnnotationSecurityAspectTests.java +++ b/aspects/src/test/java/org/springframework/security/access/intercept/aspectj/aspect/AnnotationSecurityAspectTests.java @@ -59,7 +59,8 @@ public class AnnotationSecurityAspectTests { private AffirmativeBased adm; - private @Mock AuthenticationManager authman; + @Mock + private AuthenticationManager authman; private TestingAuthenticationToken anne = new TestingAuthenticationToken("anne", "", "ROLE_A"); diff --git a/core/src/test/java/org/springframework/security/access/intercept/aspectj/AspectJMethodSecurityInterceptorTests.java b/core/src/test/java/org/springframework/security/access/intercept/aspectj/AspectJMethodSecurityInterceptorTests.java index 6ea44ac332..08ef48c501 100644 --- a/core/src/test/java/org/springframework/security/access/intercept/aspectj/AspectJMethodSecurityInterceptorTests.java +++ b/core/src/test/java/org/springframework/security/access/intercept/aspectj/AspectJMethodSecurityInterceptorTests.java @@ -68,13 +68,17 @@ public class AspectJMethodSecurityInterceptorTests { private AspectJMethodSecurityInterceptor interceptor; - private @Mock AccessDecisionManager adm; + @Mock + private AccessDecisionManager adm; - private @Mock MethodSecurityMetadataSource mds; + @Mock + private MethodSecurityMetadataSource mds; - private @Mock AuthenticationManager authman; + @Mock + private AuthenticationManager authman; - private @Mock AspectJCallback aspectJCallback; + @Mock + private AspectJCallback aspectJCallback; private ProceedingJoinPoint joinPoint;