Skip to content

Commit 3e75ec7

Browse files
justlikeliuensbrannen
authored andcommitted
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
1 parent 709a41f commit 3e75ec7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spring-expression/src/test/java/org/springframework/expression/spel/PropertyAccessTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -232,17 +232,17 @@ public void propertyReadWriteWithRootObject() {
232232
assertThat(context.getRootObject().getValue()).isSameAs(target);
233233

234234
Expression expr = parser.parseExpression("name");
235-
assertThat(expr.getValue(context, target)).isEqualTo("p1");
235+
assertThat(expr.getValue(context)).isEqualTo("p1");
236236
target.setName("p2");
237-
assertThat(expr.getValue(context, target)).isEqualTo("p2");
237+
assertThat(expr.getValue(context)).isEqualTo("p2");
238238

239239
parser.parseExpression("name='p3'").getValue(context, target);
240240
assertThat(target.getName()).isEqualTo("p3");
241-
assertThat(expr.getValue(context, target)).isEqualTo("p3");
241+
assertThat(expr.getValue(context)).isEqualTo("p3");
242242

243-
expr.setValue(context, target, "p4");
243+
expr.setValue(context, "p4");
244244
assertThat(target.getName()).isEqualTo("p4");
245-
assertThat(expr.getValue(context, target)).isEqualTo("p4");
245+
assertThat(expr.getValue(context)).isEqualTo("p4");
246246
}
247247

248248
@Test

0 commit comments

Comments
 (0)