Restored original 4.3.x expectation for property access on null target

This commit is contained in:
Juergen Hoeller
2018-03-28 11:40:24 +02:00
parent 1897d8e858
commit f32b13c5b3

View File

@@ -236,7 +236,7 @@ public class SpelReproTests extends AbstractExpressionTests {
}
@Test
public void accessingNullPropertyViaReflection_SPR5663() throws AccessException {
public void propertyAccessOnNullTarget_SPR5663() throws AccessException {
PropertyAccessor accessor = new ReflectivePropertyAccessor();
EvaluationContext context = TestScenarioCreator.getTestEvaluationContext();
assertFalse(accessor.canRead(context, null, "abc"));
@@ -244,17 +244,17 @@ public class SpelReproTests extends AbstractExpressionTests {
try {
accessor.read(context, null, "abc");
fail("Should have failed with an IllegalStateException");
fail("Should have failed with an AccessException");
}
catch (IllegalStateException ex) {
catch (AccessException ex) {
// expected
}
try {
accessor.write(context, null, "abc", "foo");
fail("Should have failed with an IllegalStateException");
fail("Should have failed with an AccessException");
}
catch (IllegalStateException ex) {
catch (AccessException ex) {
// expected
}
}