From 8abb882927e1071e3986b332f581b9c4ffe5c7e7 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Fri, 1 Apr 2016 10:27:14 -0500 Subject: [PATCH] Rename poorly named withUser variable WithSecurityContextTestExecutionListener used the variable name withUser in mulitple places when it should have been named withSecurityContext. This commit renames the variables to withSecurityContext. Fixes gh-3775 --- .../WithSecurityContextTestExecutionListener.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/src/main/java/org/springframework/security/test/context/support/WithSecurityContextTestExecutionListener.java b/test/src/main/java/org/springframework/security/test/context/support/WithSecurityContextTestExecutionListener.java index 1fc684a64b..3cc8a505d3 100644 --- a/test/src/main/java/org/springframework/security/test/context/support/WithSecurityContextTestExecutionListener.java +++ b/test/src/main/java/org/springframework/security/test/context/support/WithSecurityContextTestExecutionListener.java @@ -66,10 +66,10 @@ public class WithSecurityContextTestExecutionListener extends @SuppressWarnings({ "rawtypes", "unchecked" }) private SecurityContext createSecurityContext(AnnotatedElement annotated, TestContext context) { - WithSecurityContext withUser = AnnotationUtils.findAnnotation( + WithSecurityContext withSecurityContext = AnnotationUtils.findAnnotation( annotated, WithSecurityContext.class); - if (withUser != null) { - WithSecurityContextFactory factory = createFactory(withUser, context); + if (withSecurityContext != null) { + WithSecurityContextFactory factory = createFactory(withSecurityContext, context); Class type = (Class) GenericTypeResolver.resolveTypeArgument(factory.getClass(), WithSecurityContextFactory.class); Annotation annotation = AnnotationUtils.findAnnotation(annotated, type); try { @@ -84,8 +84,8 @@ public class WithSecurityContextTestExecutionListener extends } private WithSecurityContextFactory createFactory( - WithSecurityContext withUser, TestContext testContext) { - Class> clazz = withUser + WithSecurityContext withSecurityContext, TestContext testContext) { + Class> clazz = withSecurityContext .factory(); try { return testContext.getApplicationContext().getAutowireCapableBeanFactory().createBean(clazz);