From 3e75ec73ab7177f8006187ee19195d089e8475f6 Mon Sep 17 00:00:00 2001 From: justlikeliuen Date: Sat, 8 Jan 2022 10:45:16 +0800 Subject: [PATCH] Fix SpEL withRootObject test The test case is intended to be for the method 'withRootObject()', but actually it's copied from the previous test method that does not use 'withRootObject()'. This commit fixes the propertyReadWriteWithRootObject() test method in PropertyAccessTests. Closes gh-27905 --- .../expression/spel/PropertyAccessTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 b5247527eb..04bf034fd8 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -232,17 +232,17 @@ public class PropertyAccessTests extends AbstractExpressionTests { assertThat(context.getRootObject().getValue()).isSameAs(target); Expression expr = parser.parseExpression("name"); - assertThat(expr.getValue(context, target)).isEqualTo("p1"); + assertThat(expr.getValue(context)).isEqualTo("p1"); target.setName("p2"); - assertThat(expr.getValue(context, target)).isEqualTo("p2"); + assertThat(expr.getValue(context)).isEqualTo("p2"); parser.parseExpression("name='p3'").getValue(context, target); assertThat(target.getName()).isEqualTo("p3"); - assertThat(expr.getValue(context, target)).isEqualTo("p3"); + assertThat(expr.getValue(context)).isEqualTo("p3"); - expr.setValue(context, target, "p4"); + expr.setValue(context, "p4"); assertThat(target.getName()).isEqualTo("p4"); - assertThat(expr.getValue(context, target)).isEqualTo("p4"); + assertThat(expr.getValue(context)).isEqualTo("p4"); } @Test