@@ -305,6 +305,43 @@ public void test_import_from_to_Prefix() throws ArangoException, IOException {
305
305
}
306
306
}
307
307
308
+ @ Test
309
+ public void test_import_from_to_Prefix_with_errors_details () throws ArangoException , IOException {
310
+ ImportOptionsJson options = new ImportOptionsJson ();
311
+ {
312
+ Collection <BaseDocument > docs = new ArrayList <BaseDocument >();
313
+ for (int i = 0 ; i < 100 ; i ++) {
314
+ BaseDocument doc = new BaseDocument ();
315
+ doc .setDocumentKey (String .valueOf (i ));
316
+ docs .add (doc );
317
+ }
318
+ {
319
+ final ImportResultEntity result = driver .importDocuments (UT_IMPORT_TEST , docs , options );
320
+ assertThat (result .getStatusCode (), is (201 ));
321
+ assertThat (result .isError (), is (false ));
322
+ assertThat (result .getCreated (), is (docs .size ()));
323
+ }
324
+ }
325
+ {
326
+ Collection <Map <String , Object >> edgeDocs = new ArrayList <Map <String , Object >>();
327
+ for (int i = 0 ; i < 100 ; i ++) {
328
+ final HashMap <String , Object > doc = new HashMap <String , Object >();
329
+ doc .put (BaseDocument .KEY , String .valueOf (i ));
330
+ // doc.put(BaseDocument.FROM, String.valueOf(i));
331
+ doc .put (BaseDocument .TO , String .valueOf (i ));
332
+ edgeDocs .add (doc );
333
+ }
334
+ options .setFromPrefix (UT_IMPORT_TEST );
335
+ options .setToPrefix (UT_IMPORT_TEST );
336
+ options .setDetails (true );
337
+ final ImportResultEntity result = driver .importDocuments (UT_IMPORT_TEST_EDGE , edgeDocs , options );
338
+ assertThat (result .getStatusCode (), is (201 ));
339
+ assertThat (result .isError (), is (false ));
340
+ assertThat (result .getErrors (), is (edgeDocs .size ()));
341
+ assertThat (result .getDetails ().size (), is (edgeDocs .size ()));
342
+ }
343
+ }
344
+
308
345
@ Test
309
346
public void test_import_rawList () throws ArangoException {
310
347
String values = "[{\" _key\" :\" a\" },{\" _key\" :\" b\" }]" ;
0 commit comments