4141 * @author cstamas
4242 *
4343 */
44- public class InterpolatorFilterReaderTest {
44+ class InterpolatorFilterReaderTest {
4545/*
4646 * Added and commented by jdcasey@03-Feb-2005 because it is a bug in the InterpolationFilterReader.
4747 * kenneyw@15-04-2005 fixed the bug.
4848 */
4949@ Test
50- public void testShouldNotInterpolateExpressionAtEndOfDataWithInvalidEndToken () throws Exception {
51- Map m = new HashMap ();
50+ void shouldNotInterpolateExpressionAtEndOfDataWithInvalidEndToken () throws Exception {
51+ Map < String , String > m = new HashMap <> ();
5252m .put ("test" , "TestValue" );
5353
5454String testStr = "This is a ${test" ;
@@ -60,8 +60,8 @@ public void testShouldNotInterpolateExpressionAtEndOfDataWithInvalidEndToken() t
6060 * kenneyw@14-04-2005 Added test to check above fix.
6161 */
6262@ Test
63- public void testShouldNotInterpolateExpressionWithMissingEndToken () throws Exception {
64- Map m = new HashMap ();
63+ void shouldNotInterpolateExpressionWithMissingEndToken () throws Exception {
64+ Map < String , String > m = new HashMap <> ();
6565m .put ("test" , "TestValue" );
6666
6767String testStr = "This is a ${test, really" ;
@@ -70,8 +70,8 @@ public void testShouldNotInterpolateExpressionWithMissingEndToken() throws Excep
7070 }
7171
7272@ Test
73- public void testShouldNotInterpolateWithMalformedStartToken () throws Exception {
74- Map m = new HashMap ();
73+ void shouldNotInterpolateWithMalformedStartToken () throws Exception {
74+ Map < String , String > m = new HashMap <> ();
7575m .put ("test" , "testValue" );
7676
7777String foo = "This is a $!test} again" ;
@@ -80,8 +80,8 @@ public void testShouldNotInterpolateWithMalformedStartToken() throws Exception{
8080 }
8181
8282@ Test
83- public void testShouldNotInterpolateWithMalformedEndToken () throws Exception {
84- Map m = new HashMap ();
83+ void shouldNotInterpolateWithMalformedEndToken () throws Exception {
84+ Map < String , String > m = new HashMap <> ();
8585m .put ("test" , "testValue" );
8686
8787String foo = "This is a ${test!} again" ;
@@ -90,8 +90,8 @@ public void testShouldNotInterpolateWithMalformedEndToken() throws Exception{
9090 }
9191
9292@ Test
93- public void testDefaultInterpolationWithNonInterpolatedValueAtEnd () throws Exception {
94- Map m = new HashMap ();
93+ void defaultInterpolationWithNonInterpolatedValueAtEnd () throws Exception {
94+ Map < String , String > m = new HashMap <> ();
9595m .put ("name" , "jason" );
9696m .put ("noun" , "asshole" );
9797
@@ -101,8 +101,8 @@ public void testDefaultInterpolationWithNonInterpolatedValueAtEnd() throws Excep
101101 }
102102
103103@ Test
104- public void testDefaultInterpolationWithInterpolatedValueAtEnd () throws Exception {
105- Map m = new HashMap ();
104+ void defaultInterpolationWithInterpolatedValueAtEnd () throws Exception {
105+ Map < String , String > m = new HashMap <> ();
106106m .put ("name" , "jason" );
107107m .put ("noun" , "asshole" );
108108
@@ -112,8 +112,8 @@ public void testDefaultInterpolationWithInterpolatedValueAtEnd() throws Exceptio
112112 }
113113
114114@ Test
115- public void testInterpolationWithInterpolatedValueAtEndWithCustomToken () throws Exception {
116- Map m = new HashMap ();
115+ void interpolationWithInterpolatedValueAtEndWithCustomToken () throws Exception {
116+ Map < String , String > m = new HashMap <> ();
117117m .put ("name" , "jason" );
118118m .put ("noun" , "asshole" );
119119
@@ -123,8 +123,8 @@ public void testInterpolationWithInterpolatedValueAtEndWithCustomToken() throws
123123 }
124124
125125@ Test
126- public void testInterpolationWithInterpolatedValueAtEndWithCustomTokenAndCustomString () throws Exception {
127- Map m = new HashMap ();
126+ void interpolationWithInterpolatedValueAtEndWithCustomTokenAndCustomString () throws Exception {
127+ Map < String , String > m = new HashMap <> ();
128128m .put ("name" , "jason" );
129129m .put ("noun" , "asshole" );
130130
@@ -134,8 +134,8 @@ public void testInterpolationWithInterpolatedValueAtEndWithCustomTokenAndCustomS
134134 }
135135
136136@ Test
137- public void testEscape () throws Exception {
138- Map m = new HashMap ();
137+ void escape () throws Exception {
138+ Map < String , String > m = new HashMap <> ();
139139m .put ("name" , "jason" );
140140m .put ("noun" , "asshole" );
141141
@@ -145,8 +145,8 @@ public void testEscape() throws Exception{
145145 }
146146
147147@ Test
148- public void testEscapeAtStart () throws Exception {
149- Map m = new HashMap ();
148+ void escapeAtStart () throws Exception {
149+ Map < String , String > m = new HashMap <> ();
150150m .put ("name" , "jason" );
151151m .put ("noun" , "asshole" );
152152
@@ -156,8 +156,8 @@ public void testEscapeAtStart() throws Exception{
156156 }
157157
158158@ Test
159- public void testEscapeOnlyAtStart () throws Exception {
160- Map m = new HashMap ();
159+ void escapeOnlyAtStart () throws Exception {
160+ Map < String , String > m = new HashMap <> ();
161161m .put ("name" , "jason" );
162162m .put ("noun" , "asshole" );
163163
@@ -168,8 +168,8 @@ public void testEscapeOnlyAtStart() throws Exception{
168168 }
169169
170170@ Test
171- public void testEscapeOnlyAtStartDefaultToken () throws Exception {
172- Map m = new HashMap ();
171+ void escapeOnlyAtStartDefaultToken () throws Exception {
172+ Map < String , String > m = new HashMap <> ();
173173m .put ("name" , "jason" );
174174m .put ("noun" , "asshole" );
175175
@@ -180,15 +180,15 @@ public void testEscapeOnlyAtStartDefaultToken() throws Exception{
180180 }
181181
182182@ Test
183- public void testShouldDetectRecursiveExpressionPassingThroughTwoPrefixes () throws Exception {
184- List prefixes = new ArrayList ();
183+ void shouldDetectRecursiveExpressionPassingThroughTwoPrefixes () throws Exception {
184+ List < String > prefixes = new ArrayList <> ();
185185
186186prefixes .add ("prefix1" );
187187prefixes .add ("prefix2" );
188188
189189RecursionInterceptor ri = new PrefixAwareRecursionInterceptor (prefixes , false );
190190
191- Map context = new HashMap ();
191+ Map < String , String > context = new HashMap <> ();
192192context .put ("name" , "${prefix2.name}" );
193193
194194String input = "${prefix1.name}" ;
@@ -211,14 +211,14 @@ public void testShouldDetectRecursiveExpressionPassingThroughTwoPrefixes() throw
211211 }
212212
213213@ Test
214- public void testShouldDetectRecursiveExpressionWithPrefixAndWithout () throws Exception {
215- List prefixes = new ArrayList ();
214+ void shouldDetectRecursiveExpressionWithPrefixAndWithout () throws Exception {
215+ List < String > prefixes = new ArrayList <> ();
216216
217217prefixes .add ("prefix1" );
218218
219219RecursionInterceptor ri = new PrefixAwareRecursionInterceptor (prefixes , false );
220220
221- Map context = new HashMap ();
221+ Map < String , String > context = new HashMap <> ();
222222context .put ("name" , "${prefix1.name}" );
223223
224224String input = "${name}" ;
@@ -244,11 +244,11 @@ public void testShouldDetectRecursiveExpressionWithPrefixAndWithout() throws Exc
244244//
245245// ----------------------------------------------------------------------
246246
247- private String interpolate (String input , Map context ) throws Exception {
247+ private String interpolate (String input , Map < String , String > context ) throws Exception {
248248return interpolate (input , context , null );
249249 }
250250
251- private String interpolate (String input , Map context , String escapeStr ) throws Exception {
251+ private String interpolate (String input , Map < String , String > context , String escapeStr ) throws Exception {
252252Interpolator interpolator = new StringSearchInterpolator ();
253253
254254interpolator .addValueSource (new MapBasedValueSource (context ));
@@ -268,7 +268,8 @@ private String interpolate(String input, Map context, String escapeStr) throws E
268268return buf .toString ();
269269 }
270270
271- private String interpolate (String input , Map context , String beginToken , String endToken ) throws Exception {
271+ private String interpolate (String input , Map <String , String > context , String beginToken , String endToken )
272+ throws Exception {
272273StringSearchInterpolator interpolator = new StringSearchInterpolator (beginToken , endToken );
273274
274275interpolator .addValueSource (new MapBasedValueSource (context ));
0 commit comments