Skip to content

Commit db65afe

Browse files
committed
Changing the test to confirm the outputs are totally different.
1 parent a492e97 commit db65afe

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

marklogic-client-api/src/test/java/com/marklogic/client/test/dataservices/BulkOutputCallerNext.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
import java.io.ByteArrayInputStream;
1717
import java.io.InputStream;
18+
import java.util.ArrayList;
19+
import java.util.List;
1820
import java.util.stream.Stream;
1921

2022
import 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

Comments
 (0)