1515
1616import java .io .ByteArrayInputStream ;
1717import java .io .InputStream ;
18+ import java .util .ArrayList ;
19+ import java .util .List ;
1820import java .util .stream .Stream ;
1921
2022import static org .junit .Assert .*;
@@ -54,15 +56,19 @@ public void bulkOutputCallerNextTest() throws Exception {
5456 assertNotNull (output );
5557 InputStream [] outputArray = output .toArray (size -> new InputStream [size ]);
5658 assertTrue (outputArray .length == 5 );
59+
5760 output = bulkCaller .next ();
5861 assertNotNull (output );
5962 InputStream [] outputArray1 = output .toArray (size -> new InputStream [size ]);
6063 assertTrue (outputArray1 .length == 5 );
6164 assertFalse (outputArray .equals (outputArray1 ));
62- for (int i =0 ; i <5 ; i ++) {
63- String data = IOTestUtil .mapper .readValue (outputArray [i ], ObjectNode .class ).toString ();
64- String data1 = IOTestUtil .mapper .readValue (outputArray1 [i ], ObjectNode .class ).toString ();
65- assertFalse (data .equals (data1 ));
65+
66+ List <String > outputList = new ArrayList <>();
67+ for (InputStream i : outputArray1 ) {
68+ outputList .add (IOTestUtil .mapper .readValue (i , ObjectNode .class ).toString ());
69+ }
70+ for (InputStream i : outputArray ) {
71+ assertFalse (outputList .contains (IOTestUtil .mapper .readValue (i , ObjectNode .class ).toString ()));
6672 }
6773 }
6874
@@ -74,6 +80,5 @@ public static void cleanup() {
7480 deletedef .setCollections (collectionName );
7581 queryMgr .delete (deletedef );
7682
77- IOTestUtil .db .release ();
7883 }
7984}
0 commit comments