From 78284a62e2f1bc28d7920f157492df72b9ff07fb Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 27 Oct 2017 15:28:51 +0200 Subject: [PATCH] Polishing --- .../expression/spel/SpelReproTests.java | 12 +++++++----- 1 file changed, 7 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 b0389ab1d5b..06a102f5528 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 @@ -241,19 +241,21 @@ public class SpelReproTests extends AbstractExpressionTests { EvaluationContext context = TestScenarioCreator.getTestEvaluationContext(); assertFalse(propertyAccessor.canRead(context, null, "abc")); assertFalse(propertyAccessor.canWrite(context, null, "abc")); + try { propertyAccessor.read(context, null, "abc"); fail("Should have failed with an IllegalStateException"); } - catch (IllegalStateException ae) { - // success + catch (IllegalStateException ex) { + // expected } + try { propertyAccessor.write(context, null, "abc", "foo"); - fail("Should have failed with an AccessEIllegalStateExceptionxception"); + fail("Should have failed with an IllegalStateException"); } - catch (IllegalStateException ae) { - // success + catch (IllegalStateException ex) { + // expected } }