File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
src/test/java/com/hubspot/jinjava/el Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ public void unknownProperty() {
257257 interpreter .resolveELExpression ("foo" , 23 );
258258 assertThat (interpreter .getErrorsCopy ()).isEmpty ();
259259
260- context .put ("foo" , new Object () );
260+ context .put ("foo" , "" );
261261 interpreter .resolveELExpression ("foo.bar" , 23 );
262262
263263 assertThat (interpreter .getErrorsCopy ()).hasSize (1 );
@@ -314,7 +314,10 @@ public void blackListedMethods() {
314314
315315 assertThat (interpreter .getErrorsCopy ()).isNotEmpty ();
316316 TemplateError e = interpreter .getErrorsCopy ().get (0 );
317- assertThat (e .getMessage ()).contains ("Cannot find method 'wait'" );
317+ assertThat (e .getMessage ())
318+ .contains (
319+ "Cannot find method wait with 0 parameters in class com.hubspot.jinjava.testobjects.ExpressionResolverTestObjects$MyClass"
320+ );
318321 }
319322
320323 @ Test
@@ -324,7 +327,10 @@ public void itWillNotReturnClassObjects() {
324327
325328 assertThat (interpreter .getErrorsCopy ()).isNotEmpty ();
326329 TemplateError e = interpreter .getErrorsCopy ().get (0 );
327- assertThat (e .getMessage ()).contains ("Cannot find method 'getClass'" );
330+ assertThat (e .getMessage ())
331+ .contains (
332+ "Cannot find method getClass with 0 parameters in class com.hubspot.jinjava.testobjects.ExpressionResolverTestObjects$MyClass"
333+ );
328334 }
329335
330336 @ Test
Original file line number Diff line number Diff line change 11package com .hubspot .jinjava .el .ext ;
22
33import static org .assertj .core .api .Assertions .assertThat ;
4+ import static org .assertj .core .api .Assertions .assertThatThrownBy ;
45
56import com .hubspot .jinjava .BaseJinjavaTest ;
67import com .hubspot .jinjava .Jinjava ;
910import com .hubspot .jinjava .interpret .JinjavaInterpreter ;
1011import com .hubspot .jinjava .testobjects .JinjavaBeanELResolverTestObjects ;
1112import javax .el .ELContext ;
13+ import javax .el .PropertyNotFoundException ;
1214import org .junit .Before ;
1315import org .junit .Test ;
1416
@@ -140,7 +142,10 @@ public void itDoesNotAllowAccessingPropertiesOfInterpreter() {
140142 .closeablePushCurrent (jinjava .newInterpreter ())
141143 .get ()
142144 ) {
143- assertThat (jinjavaBeanELResolver .getValue (elContext , a .value (), "config" )).isNull ();
145+ assertThatThrownBy (() ->
146+ jinjavaBeanELResolver .getValue (elContext , a .value (), "config" )
147+ )
148+ .isInstanceOf (PropertyNotFoundException .class );
144149 }
145150 }
146151}
You can’t perform that action at this time.
0 commit comments