@@ -140,7 +140,7 @@ public void testSaveGetDeleteObjects() throws Exception {
140
140
final CountDownLatch signal = new CountDownLatch (1 );
141
141
final OfflineIndex index = client .getOfflineIndex (Helpers .getMethodName ());
142
142
index .beginTransaction ();
143
- index .saveObjectsAsync (objects .values (), new CompletionHandler () {
143
+ index .saveObjectsAsync (new JSONArray ( objects .values () ), new CompletionHandler () {
144
144
@ Override
145
145
public void requestCompleted (JSONObject content , AlgoliaException error ) {
146
146
assertNotNull (content );
@@ -195,7 +195,7 @@ public void testSaveGetDeleteObjectsSync() throws Exception {
195
195
final OfflineIndex index = client .getOfflineIndex (Helpers .getMethodName ());
196
196
try {
197
197
index .beginTransaction ();
198
- index .saveObjectsSync (objects .values ());
198
+ index .saveObjectsSync (new JSONArray ( objects .values () ));
199
199
index .commitTransactionSync ();
200
200
index .getObjectsAsync (Arrays .asList ("1" , "2" ), new CompletionHandler () {
201
201
@ Override
@@ -234,7 +234,7 @@ public void testSearch() throws Exception {
234
234
final CountDownLatch signal = new CountDownLatch (1 );
235
235
final OfflineIndex index = client .getOfflineIndex (Helpers .getMethodName ());
236
236
index .beginTransaction ();
237
- index .saveObjectsAsync (objects .values (), new CompletionHandler () {
237
+ index .saveObjectsAsync (new JSONArray ( objects .values () ), new CompletionHandler () {
238
238
@ Override
239
239
public void requestCompleted (JSONObject content , AlgoliaException error ) {
240
240
assertNull (error );
@@ -295,7 +295,7 @@ public void testClear() throws Exception {
295
295
final CountDownLatch signal = new CountDownLatch (1 );
296
296
final OfflineIndex index = client .getOfflineIndex (Helpers .getMethodName ());
297
297
index .beginTransaction ();
298
- index .saveObjectsAsync (objects .values (), new CompletionHandler () {
298
+ index .saveObjectsAsync (new JSONArray ( objects .values () ), new CompletionHandler () {
299
299
@ Override
300
300
public void requestCompleted (JSONObject content , AlgoliaException error ) {
301
301
assertNotNull (content );
@@ -336,7 +336,7 @@ public void testBrowse() throws Exception {
336
336
final CountDownLatch signal = new CountDownLatch (1 );
337
337
final OfflineIndex index = client .getOfflineIndex (Helpers .getMethodName ());
338
338
index .beginTransaction ();
339
- index .saveObjectsAsync (objects .values (), new CompletionHandler () {
339
+ index .saveObjectsAsync (new JSONArray ( objects .values () ), new CompletionHandler () {
340
340
@ Override
341
341
public void requestCompleted (JSONObject content , AlgoliaException error ) {
342
342
assertNull (error );
@@ -372,7 +372,7 @@ public void testDeleteByQuery() throws Exception {
372
372
final CountDownLatch signal = new CountDownLatch (1 );
373
373
final OfflineIndex index = client .getOfflineIndex (Helpers .getMethodName ());
374
374
index .beginTransaction ();
375
- index .saveObjectsAsync (objects .values (), new CompletionHandler () {
375
+ index .saveObjectsAsync (new JSONArray ( objects .values () ), new CompletionHandler () {
376
376
@ Override
377
377
public void requestCompleted (JSONObject content , AlgoliaException error ) {
378
378
assertNull (error );
@@ -413,7 +413,7 @@ public void testMultipleQueries() throws Exception {
413
413
final CountDownLatch signal = new CountDownLatch (1 );
414
414
final OfflineIndex index = client .getOfflineIndex (Helpers .getMethodName ());
415
415
index .beginTransaction ();
416
- index .saveObjectsAsync (objects .values (), new CompletionHandler () {
416
+ index .saveObjectsAsync (new JSONArray ( objects .values () ), new CompletionHandler () {
417
417
@ Override
418
418
public void requestCompleted (JSONObject content , AlgoliaException error ) {
419
419
assertNull (error );
@@ -459,7 +459,7 @@ public void testAddManyObjects() throws Exception {
459
459
for (int j = 0 ; j < 13 ; ++j ) {
460
460
objects .add (new JSONObject ().put ("objectID" , Integer .toString (++objectCount )));
461
461
}
462
- index .saveObjectsSync (objects );
462
+ index .saveObjectsSync (new JSONArray ( objects ) );
463
463
}
464
464
index .commitTransactionSync ();
465
465
assertTrue (objectCount <= 100 ); // required for our limited license key to work
@@ -482,7 +482,7 @@ public void testRollback() throws Exception {
482
482
final String indexName = Helpers .getMethodName ();
483
483
final OfflineIndex index = client .getOfflineIndex (indexName );
484
484
index .beginTransaction ();
485
- index .saveObjectsSync (objects .values ());
485
+ index .saveObjectsSync (new JSONArray ( objects .values () ));
486
486
index .rollbackTransactionSync ();
487
487
assertFalse (client .hasOfflineData (indexName ));
488
488
0 commit comments