1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
37
37
public class InlineCollectionTests {
38
38
39
39
@ Test
40
- public void testListCached () {
40
+ void testListCached () {
41
41
InlineList list = parseList ("{1, -2, 3, 4}" );
42
42
assertThat (list .isConstant ()).isTrue ();
43
43
assertThat (list .getConstantValue ()).isEqualTo (Arrays .asList (1 , -2 , 3 , 4 ));
44
44
}
45
45
46
46
@ Test
47
- public void testDynamicListNotCached () {
47
+ void testDynamicListNotCached () {
48
48
InlineList list = parseList ("{1, 5-2, 3, 4}" );
49
49
assertThat (list .isConstant ()).isFalse ();
50
50
assertThat (list .getValue (null )).isEqualTo (Arrays .asList (1 , 3 , 3 , 4 ));
51
51
}
52
52
53
53
@ Test
54
- public void testListWithVariableNotCached () {
54
+ void testListWithVariableNotCached () {
55
55
InlineList list = parseList ("{1, -a, 3, 4}" );
56
56
assertThat (list .isConstant ()).isFalse ();
57
57
final StandardEvaluationContext standardEvaluationContext = new StandardEvaluationContext (new AHolder ());
@@ -60,21 +60,21 @@ public void testListWithVariableNotCached() {
60
60
}
61
61
62
62
@ Test
63
- public void testListCanBeCompiled () {
63
+ void testListCanBeCompiled () {
64
64
SpelExpression listExpression = parseExpression ("{1, -2, 3, 4}" );
65
65
assertThat (((SpelNodeImpl ) listExpression .getAST ()).isCompilable ()).isTrue ();
66
66
assertThat (SpelCompiler .compile (listExpression )).isTrue ();
67
67
}
68
68
69
69
@ Test
70
- public void testDynamicListCantBeCompiled () {
70
+ void testDynamicListCantBeCompiled () {
71
71
SpelExpression listExpression = parseExpression ("{1, 5-2, 3, 4}" );
72
72
assertThat (((SpelNodeImpl ) listExpression .getAST ()).isCompilable ()).isFalse ();
73
73
assertThat (SpelCompiler .compile (listExpression )).isFalse ();
74
74
}
75
75
76
76
@ Test
77
- public void testMapCached () {
77
+ void testMapCached () {
78
78
InlineMap map = parseMap ("{1 : 2, 3 : 4}" );
79
79
assertThat (map .isConstant ()).isTrue ();
80
80
final Map <Integer , Integer > expected = new HashMap <>();
@@ -84,7 +84,7 @@ public void testMapCached() {
84
84
}
85
85
86
86
@ Test
87
- public void testMapWithNegativeKeyCached () {
87
+ void testMapWithNegativeKeyCached () {
88
88
InlineMap map = parseMap ("{-1 : 2, -3 : 4}" );
89
89
assertThat (map .isConstant ()).isTrue ();
90
90
final Map <Integer , Integer > expected = new HashMap <>();
@@ -94,7 +94,7 @@ public void testMapWithNegativeKeyCached() {
94
94
}
95
95
96
96
@ Test
97
- public void testMapWithNegativeValueCached () {
97
+ void testMapWithNegativeValueCached () {
98
98
InlineMap map = parseMap ("{1 : -2, 3 : -4}" );
99
99
assertThat (map .isConstant ()).isTrue ();
100
100
final Map <Integer , Integer > expected = new HashMap <>();
@@ -104,7 +104,7 @@ public void testMapWithNegativeValueCached() {
104
104
}
105
105
106
106
@ Test
107
- public void testMapWithNegativeLongTypesCached () {
107
+ void testMapWithNegativeLongTypesCached () {
108
108
InlineMap map = parseMap ("{1L : -2L, 3L : -4L}" );
109
109
assertThat (map .isConstant ()).isTrue ();
110
110
final Map <Long , Long > expected = new HashMap <>();
@@ -114,7 +114,7 @@ public void testMapWithNegativeLongTypesCached() {
114
114
}
115
115
116
116
@ Test
117
- public void testMapWithNegativeFloatTypesCached () {
117
+ void testMapWithNegativeFloatTypesCached () {
118
118
InlineMap map = parseMap ("{-1.0f : -2.0f, -3.0f : -4.0f}" );
119
119
assertThat (map .isConstant ()).isTrue ();
120
120
final Map <Float , Float > expected = new HashMap <>();
@@ -124,7 +124,7 @@ public void testMapWithNegativeFloatTypesCached() {
124
124
}
125
125
126
126
@ Test
127
- public void testMapWithNegativeRealTypesCached () {
127
+ void testMapWithNegativeRealTypesCached () {
128
128
InlineMap map = parseMap ("{-1.0 : -2.0, -3.0 : -4.0}" );
129
129
assertThat (map .isConstant ()).isTrue ();
130
130
final Map <Double , Double > expected = new HashMap <>();
@@ -134,7 +134,7 @@ public void testMapWithNegativeRealTypesCached() {
134
134
}
135
135
136
136
@ Test
137
- public void testMapWithNegativeKeyAndValueCached () {
137
+ void testMapWithNegativeKeyAndValueCached () {
138
138
InlineMap map = parseMap ("{-1 : -2, -3 : -4}" );
139
139
assertThat (map .isConstant ()).isTrue ();
140
140
final Map <Integer , Integer > expected = new HashMap <>();
@@ -144,7 +144,7 @@ public void testMapWithNegativeKeyAndValueCached() {
144
144
}
145
145
146
146
@ Test
147
- public void testMapWithDynamicNotCached () {
147
+ void testMapWithDynamicNotCached () {
148
148
InlineMap map = parseMap ("{-1 : 2, -3+1 : -4}" );
149
149
assertThat (map .isConstant ()).isFalse ();
150
150
final Map <Integer , Integer > expected = new HashMap <>();
0 commit comments