From f32b13c5b3d58ca748fd42846d4b4328408b8d50 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 28 Mar 2018 11:40:24 +0200 Subject: [PATCH] Restored original 4.3.x expectation for property access on null target --- .../expression/spel/SpelReproTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java index 534f8025ed4..d5a8be4385f 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java @@ -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 } }