From 59c6b7e44543d3fdadfb78ae3c6a7c76de2fce91 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 8 Jan 2022 17:05:21 +0100 Subject: [PATCH] Fix SpEL withTypedRootObject() test --- .../expression/spel/PropertyAccessTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/PropertyAccessTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/PropertyAccessTests.java index 04bf034fd8..bf99547903 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/PropertyAccessTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/PropertyAccessTests.java @@ -262,12 +262,12 @@ public class PropertyAccessTests extends AbstractExpressionTests { @Test public void propertyAccessWithInstanceMethodResolverAndTypedRootObject() { - Person target = new Person("p1"); + Person rootObject = new Person("p1"); EvaluationContext context = SimpleEvaluationContext.forReadOnlyDataBinding(). - withInstanceMethods().withTypedRootObject(target, TypeDescriptor.valueOf(Object.class)).build(); + withInstanceMethods().withTypedRootObject(rootObject, TypeDescriptor.valueOf(Object.class)).build(); - assertThat(parser.parseExpression("name.substring(1)").getValue(context, target)).isEqualTo("1"); - assertThat(context.getRootObject().getValue()).isSameAs(target); + assertThat(parser.parseExpression("name.substring(1)").getValue(context)).isEqualTo("1"); + assertThat(context.getRootObject().getValue()).isSameAs(rootObject); assertThat(context.getRootObject().getTypeDescriptor().getType()).isSameAs(Object.class); }