Skip to content

Commit b60cc54

Browse files
committed
Update tests for 6.2
See gh-33861
1 parent 4435275 commit b60cc54

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

spring-expression/src/test/java/org/springframework/expression/spel/ast/AstUtilsTests.java

+3-11
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.util.List;
2020

21-
import org.junit.jupiter.api.Disabled;
2221
import org.junit.jupiter.api.Test;
2322

2423
import org.springframework.expression.EvaluationContext;
@@ -79,17 +78,10 @@ void singleExactTypeMatch() {
7978
@Test
8079
void exactTypeMatches() {
8180
List<PropertyAccessor> accessorsToTry = getPropertyAccessorsToTry(new Cat(), accessors);
82-
// We would actually expect the following.
83-
// assertThat(accessorsToTry).containsExactly(
84-
// cat1Accessor, cat2Accessor, animal1Accessor, animal2Accessor, generic1Accessor, generic2Accessor);
85-
// However, prior to Spring Framework 6.2, the supertype and generic accessors are not
86-
// ordered properly. So we test that the exact matches come first and in the expected order.
87-
assertThat(accessorsToTry)
88-
.hasSize(accessors.size())
89-
.startsWith(cat1Accessor, cat2Accessor);
81+
assertThat(accessorsToTry).containsExactly(
82+
cat1Accessor, cat2Accessor, animal1Accessor, animal2Accessor, generic1Accessor, generic2Accessor);
9083
}
9184

92-
@Disabled("PropertyAccessor ordering for supertype and generic matches is broken prior to Spring Framework 6.2")
9385
@Test
9486
void supertypeMatches() {
9587
List<PropertyAccessor> accessorsToTry = getPropertyAccessorsToTry(new Dog(), accessors);
@@ -109,7 +101,7 @@ private static PropertyAccessor createAccessor(String name, Class<?> type) {
109101
}
110102

111103
private static List<PropertyAccessor> getPropertyAccessorsToTry(Object target, List<PropertyAccessor> propertyAccessors) {
112-
return AstUtils.getPropertyAccessorsToTry(target.getClass(), propertyAccessors);
104+
return AstUtils.getAccessorsToTry(target, propertyAccessors);
113105
}
114106

115107

0 commit comments

Comments
 (0)