|
|
|
|
@ -59,7 +59,7 @@ public class SpelExceptionTests {
@@ -59,7 +59,7 @@ public class SpelExceptionTests {
|
|
|
|
|
ExpressionParser parser = new SpelExpressionParser(); |
|
|
|
|
Expression spelExpression = parser.parseExpression("#aMap['one'] eq 1"); |
|
|
|
|
StandardEvaluationContext ctx = new StandardEvaluationContext(); |
|
|
|
|
ctx.setVariables(new HashMap<String, Object>() { |
|
|
|
|
ctx.setVariables(new HashMap<>() { |
|
|
|
|
{ |
|
|
|
|
put("aMap", new HashMap<String, Integer>() { |
|
|
|
|
{ |
|
|
|
|
@ -98,7 +98,7 @@ public class SpelExceptionTests {
@@ -98,7 +98,7 @@ public class SpelExceptionTests {
|
|
|
|
|
ExpressionParser parser = new SpelExpressionParser(); |
|
|
|
|
Expression spelExpression = parser.parseExpression("#aList.contains('one')"); |
|
|
|
|
StandardEvaluationContext ctx = new StandardEvaluationContext(); |
|
|
|
|
ctx.setVariables(new HashMap<String, Object>() { |
|
|
|
|
ctx.setVariables(new HashMap<>() { |
|
|
|
|
{ |
|
|
|
|
put("aList", new ArrayList<String>() { |
|
|
|
|
{ |
|
|
|
|
@ -120,7 +120,7 @@ public class SpelExceptionTests {
@@ -120,7 +120,7 @@ public class SpelExceptionTests {
|
|
|
|
|
ExpressionParser parser = new SpelExpressionParser(); |
|
|
|
|
Expression spelExpression = parser.parseExpression("#aList[0] eq 'one'"); |
|
|
|
|
StandardEvaluationContext ctx = new StandardEvaluationContext(); |
|
|
|
|
ctx.setVariables(new HashMap<String, Object>() { |
|
|
|
|
ctx.setVariables(new HashMap<>() { |
|
|
|
|
{ |
|
|
|
|
put("aList", new ArrayList<String>() { |
|
|
|
|
{ |
|
|
|
|
@ -150,9 +150,9 @@ public class SpelExceptionTests {
@@ -150,9 +150,9 @@ public class SpelExceptionTests {
|
|
|
|
|
ExpressionParser parser = new SpelExpressionParser(); |
|
|
|
|
Expression spelExpression = parser.parseExpression("#anArray[0] eq 1"); |
|
|
|
|
StandardEvaluationContext ctx = new StandardEvaluationContext(); |
|
|
|
|
ctx.setVariables(new HashMap<String, Object>() { |
|
|
|
|
ctx.setVariables(new HashMap<>() { |
|
|
|
|
{ |
|
|
|
|
put("anArray", new int[] {1,2,3}); |
|
|
|
|
put("anArray", new int[]{1, 2, 3}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
boolean result = spelExpression.getValue(ctx, Boolean.class); |
|
|
|
|
|