File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/test/java/com/arangodb Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -798,6 +798,25 @@ public void transactionCollection() {
798798 assertThat (result , is ("hello world" ));
799799 }
800800
801+ @ Test
802+ public void transactionInsertJson () {
803+ try {
804+ db .createCollection (COLLECTION_NAME );
805+ final TransactionOptions options = new TransactionOptions ().params ("{\" _key\" :\" 0\" }" )
806+ .writeCollections (COLLECTION_NAME );
807+ //@formatter:off
808+ db .transaction ("function (params) { "
809+ + "var db = require('internal').db;"
810+ + "db." + COLLECTION_NAME + ".save(JSON.parse(params));"
811+ + "}" , Void .class , options );
812+ //@formatter:on
813+ assertThat (db .collection (COLLECTION_NAME ).count ().getCount (), is (1L ));
814+ assertThat (db .collection (COLLECTION_NAME ).getDocument ("0" , String .class ), is (notNullValue ()));
815+ } finally {
816+ db .collection (COLLECTION_NAME ).drop ();
817+ }
818+ }
819+
801820 @ Test
802821 public void transactionEmpty () {
803822 db .transaction ("function () {}" , null , null );
You can’t perform that action at this time.
0 commit comments