Skip to content

Commit 48c4d47

Browse files
author
mpv1989
committed
added transaction test
1 parent f5428f8 commit 48c4d47

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/test/java/com/arangodb/ArangoDatabaseTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,26 @@ public void transactionallowImplicit() {
827827
}
828828
}
829829

830+
protected static class TransactionTestEntity {
831+
private String value;
832+
833+
public TransactionTestEntity() {
834+
super();
835+
}
836+
}
837+
838+
@Test
839+
public void transactionPojoReturn() {
840+
final String action = "function() { return {'value':'hello world'}; }";
841+
final CompletableFuture<TransactionTestEntity> f = db.transaction(action, TransactionTestEntity.class,
842+
new TransactionOptions());
843+
assertThat(f, is(notNullValue()));
844+
f.whenComplete((res, ex) -> {
845+
assertThat(res, is(notNullValue()));
846+
assertThat(res.value, is("hello world"));
847+
});
848+
}
849+
830850
@Test
831851
public void getInfo() throws InterruptedException, ExecutionException {
832852
final CompletableFuture<DatabaseEntity> f = db.getInfo();

0 commit comments

Comments
 (0)