@@ -325,7 +325,7 @@ public interface NoArgumentsConstant {
325325 Object execute (String foo );
326326 }
327327 public void testNoArgumentsConstant () {
328- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
328+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
329329 scriptEngine .compile (NoArgumentsConstant .class , null , "1" , emptyMap ()));
330330 assertThat (e .getMessage (), startsWith ("Painless needs a constant [String[] ARGUMENTS] on all interfaces it implements with the "
331331 + "names of the method arguments but [" + NoArgumentsConstant .class .getName () + "] doesn't have one." ));
@@ -336,7 +336,7 @@ public interface WrongArgumentsConstant {
336336 Object execute (String foo );
337337 }
338338 public void testWrongArgumentsConstant () {
339- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
339+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
340340 scriptEngine .compile (WrongArgumentsConstant .class , null , "1" , emptyMap ()));
341341 assertThat (e .getMessage (), startsWith ("Painless needs a constant [String[] ARGUMENTS] on all interfaces it implements with the "
342342 + "names of the method arguments but [" + WrongArgumentsConstant .class .getName () + "] doesn't have one." ));
@@ -347,7 +347,7 @@ public interface WrongLengthOfArgumentConstant {
347347 Object execute (String foo );
348348 }
349349 public void testWrongLengthOfArgumentConstant () {
350- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
350+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
351351 scriptEngine .compile (WrongLengthOfArgumentConstant .class , null , "1" , emptyMap ()));
352352 assertThat (e .getMessage (), startsWith ("[" + WrongLengthOfArgumentConstant .class .getName () + "#ARGUMENTS] has length [2] but ["
353353 + WrongLengthOfArgumentConstant .class .getName () + "#execute] takes [1] argument." ));
@@ -358,7 +358,7 @@ public interface UnknownArgType {
358358 Object execute (UnknownArgType foo );
359359 }
360360 public void testUnknownArgType () {
361- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
361+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
362362 scriptEngine .compile (UnknownArgType .class , null , "1" , emptyMap ()));
363363 assertEquals ("[foo] is of unknown type [" + UnknownArgType .class .getName () + ". Painless interfaces can only accept arguments "
364364 + "that are of whitelisted types." , e .getMessage ());
@@ -369,7 +369,7 @@ public interface UnknownReturnType {
369369 UnknownReturnType execute (String foo );
370370 }
371371 public void testUnknownReturnType () {
372- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
372+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
373373 scriptEngine .compile (UnknownReturnType .class , null , "1" , emptyMap ()));
374374 assertEquals ("Painless can only implement execute methods returning a whitelisted type but [" + UnknownReturnType .class .getName ()
375375 + "#execute] returns [" + UnknownReturnType .class .getName () + "] which isn't whitelisted." , e .getMessage ());
@@ -380,7 +380,7 @@ public interface UnknownArgTypeInArray {
380380 Object execute (UnknownArgTypeInArray [] foo );
381381 }
382382 public void testUnknownArgTypeInArray () {
383- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
383+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
384384 scriptEngine .compile (UnknownArgTypeInArray .class , null , "1" , emptyMap ()));
385385 assertEquals ("[foo] is of unknown type [" + UnknownArgTypeInArray .class .getName () + ". Painless interfaces can only accept "
386386 + "arguments that are of whitelisted types." , e .getMessage ());
@@ -391,7 +391,7 @@ public interface TwoExecuteMethods {
391391 Object execute (boolean foo );
392392 }
393393 public void testTwoExecuteMethods () {
394- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
394+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
395395 scriptEngine .compile (TwoExecuteMethods .class , null , "null" , emptyMap ()));
396396 assertEquals ("Painless can only implement interfaces that have a single method named [execute] but ["
397397 + TwoExecuteMethods .class .getName () + "] has more than one." , e .getMessage ());
@@ -401,7 +401,7 @@ public interface BadMethod {
401401 Object something ();
402402 }
403403 public void testBadMethod () {
404- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
404+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
405405 scriptEngine .compile (BadMethod .class , null , "null" , emptyMap ()));
406406 assertEquals ("Painless can only implement methods named [execute] and [uses$argName] but [" + BadMethod .class .getName ()
407407 + "] contains a method named [something]" , e .getMessage ());
@@ -413,7 +413,7 @@ public interface BadUsesReturn {
413413 Object uses$foo ();
414414 }
415415 public void testBadUsesReturn () {
416- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
416+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
417417 scriptEngine .compile (BadUsesReturn .class , null , "null" , emptyMap ()));
418418 assertEquals ("Painless can only implement uses$ methods that return boolean but [" + BadUsesReturn .class .getName ()
419419 + "#uses$foo] returns [java.lang.Object]." , e .getMessage ());
@@ -425,7 +425,7 @@ public interface BadUsesParameter {
425425 boolean uses$bar (boolean foo );
426426 }
427427 public void testBadUsesParameter () {
428- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
428+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
429429 scriptEngine .compile (BadUsesParameter .class , null , "null" , emptyMap ()));
430430 assertEquals ("Painless can only implement uses$ methods that do not take parameters but [" + BadUsesParameter .class .getName ()
431431 + "#uses$bar] does." , e .getMessage ());
@@ -437,7 +437,7 @@ public interface BadUsesName {
437437 boolean uses$baz ();
438438 }
439439 public void testBadUsesName () {
440- Exception e = expectScriptThrows (IllegalArgumentException .class , () ->
440+ Exception e = expectScriptThrows (IllegalArgumentException .class , false , () ->
441441 scriptEngine .compile (BadUsesName .class , null , "null" , emptyMap ()));
442442 assertEquals ("Painless can only implement uses$ methods that match a parameter name but [" + BadUsesName .class .getName ()
443443 + "#uses$baz] doesn't match any of [foo, bar]." , e .getMessage ());
0 commit comments