mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-02 04:09:01 +00:00
Restored original 4.3.x expectation for property access on null target
This commit is contained in:
+5
-5
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user