Browse Source

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
Rob Winch 9 years ago
parent
commit
8abb882927

+ 5 - 5
test/src/main/java/org/springframework/security/test/context/support/WithSecurityContextTestExecutionListener.java

@@ -66,10 +66,10 @@ public class WithSecurityContextTestExecutionListener extends
 	@SuppressWarnings({ "rawtypes", "unchecked" })
 	@SuppressWarnings({ "rawtypes", "unchecked" })
 	private SecurityContext createSecurityContext(AnnotatedElement annotated,
 	private SecurityContext createSecurityContext(AnnotatedElement annotated,
 			TestContext context) {
 			TestContext context) {
-		WithSecurityContext withUser = AnnotationUtils.findAnnotation(
+		WithSecurityContext withSecurityContext = AnnotationUtils.findAnnotation(
 				annotated, WithSecurityContext.class);
 				annotated, WithSecurityContext.class);
-		if (withUser != null) {
-			WithSecurityContextFactory factory = createFactory(withUser, context);
+		if (withSecurityContext != null) {
+			WithSecurityContextFactory factory = createFactory(withSecurityContext, context);
 			Class<? extends Annotation> type = (Class<? extends Annotation>) GenericTypeResolver.resolveTypeArgument(factory.getClass(), WithSecurityContextFactory.class);
 			Class<? extends Annotation> type = (Class<? extends Annotation>) GenericTypeResolver.resolveTypeArgument(factory.getClass(), WithSecurityContextFactory.class);
 			Annotation annotation  = AnnotationUtils.findAnnotation(annotated, type);
 			Annotation annotation  = AnnotationUtils.findAnnotation(annotated, type);
 			try {
 			try {
@@ -84,8 +84,8 @@ public class WithSecurityContextTestExecutionListener extends
 	}
 	}
 
 
 	private WithSecurityContextFactory<? extends Annotation> createFactory(
 	private WithSecurityContextFactory<? extends Annotation> createFactory(
-			WithSecurityContext withUser, TestContext testContext) {
-		Class<? extends WithSecurityContextFactory<? extends Annotation>> clazz = withUser
+			WithSecurityContext withSecurityContext, TestContext testContext) {
+		Class<? extends WithSecurityContextFactory<? extends Annotation>> clazz = withSecurityContext
 				.factory();
 				.factory();
 		try {
 		try {
 			return testContext.getApplicationContext().getAutowireCapableBeanFactory().createBean(clazz);
 			return testContext.getApplicationContext().getAutowireCapableBeanFactory().createBean(clazz);