@@ -99,22 +99,18 @@ public static void setup() {
9999 @ Test
100100 public void forArgsGeneratorTest () {
101101 List <Double > outputValues = new ArrayList <Double >();
102+ final List <Double > inputValues = Stream
103+ .iterate (10.0 , last -> last - Double .valueOf (1 ))
104+ .limit (10 )
105+ .collect (Collectors .toList ());
106+ Collections .sort (inputValues );
102107 class Output {
103- List <Double > inputValues = new ArrayList <Double >();
104- int i ;
105- Output () {
106- inputValues = Stream
107- .iterate (10.0 , last -> last - Double .valueOf (1 ))
108- .limit (10 )
109- .collect (Collectors .toList ());
110- Collections .sort (inputValues );
111- i = 0 ;
112- }
108+ int i = 0 ;
113109 }
114110 final Output output = new Output ();
115111 batcher = caller
116112 .batcher ()
117- .forArgsGenerator (result -> (result == null || output .i <output . inputValues .size ()) ? caller .args ().param ("param1" , output . inputValues .get (output .i )) : null )
113+ .forArgsGenerator (result -> (result == null || output .i <inputValues .size ()) ? caller .args ().param ("param1" , inputValues .get (output .i )) : null )
118114 .onCallSuccess (event -> {
119115 output .i += 1 ;
120116 outputValues .add (event .getItem ());
@@ -125,7 +121,7 @@ class Output {
125121 batcher .awaitCompletion ();
126122 batcher .stopJob ();
127123 Collections .sort (outputValues );
128- assertEquals ("forArgsGenerator input not equal to output." , outputValues , output . inputValues );
124+ assertEquals ("forArgsGenerator input not equal to output." , outputValues , inputValues );
129125 }
130126
131127 @ Test
0 commit comments