@@ -73,7 +73,7 @@ public void beginStreamTransaction() {
73
73
74
74
StreamTransactionEntity tx = db .beginStreamTransaction (null );
75
75
assertThat (tx .getId (), is (notNullValue ()));
76
- assertThat (tx .getStatus (), is (StreamTransactionEntity . StreamTransactionStatus .running ));
76
+ assertThat (tx .getStatus (), is (StreamTransactionStatus .running ));
77
77
db .abortStreamTransaction (tx .getId ());
78
78
}
79
79
@@ -97,7 +97,7 @@ public void abortStreamTransaction() {
97
97
98
98
assertThat (abortedTx .getId (), is (notNullValue ()));
99
99
assertThat (abortedTx .getId (), is (begunTx .getId ()));
100
- assertThat (abortedTx .getStatus (), is (StreamTransactionEntity . StreamTransactionStatus .aborted ));
100
+ assertThat (abortedTx .getStatus (), is (StreamTransactionStatus .aborted ));
101
101
}
102
102
103
103
@ Test
@@ -151,7 +151,7 @@ public void getStreamTransaction() {
151
151
152
152
assertThat (gotTx .getId (), is (notNullValue ()));
153
153
assertThat (gotTx .getId (), is (createdTx .getId ()));
154
- assertThat (gotTx .getStatus (), is (StreamTransactionEntity . StreamTransactionStatus .running ));
154
+ assertThat (gotTx .getStatus (), is (StreamTransactionStatus .running ));
155
155
156
156
db .abortStreamTransaction (createdTx .getId ());
157
157
}
@@ -185,7 +185,7 @@ public void commitStreamTransaction() {
185
185
186
186
assertThat (committedTx .getId (), is (notNullValue ()));
187
187
assertThat (committedTx .getId (), is (createdTx .getId ()));
188
- assertThat (committedTx .getStatus (), is (StreamTransactionEntity . StreamTransactionStatus .committed ));
188
+ assertThat (committedTx .getStatus (), is (StreamTransactionStatus .committed ));
189
189
}
190
190
191
191
@ Test
@@ -705,4 +705,25 @@ public void nextCursor() {
705
705
db .abortStreamTransaction (tx .getId ());
706
706
}
707
707
708
+ @ Test
709
+ public void getStreamTransactions () {
710
+ assumeTrue (requireSingleServer ());
711
+ assumeTrue (requireVersion (3 , 5 ));
712
+ assumeTrue (requireStorageEngine (ArangoDBEngine .StorageEngineName .rocksdb ));
713
+
714
+ StreamTransactionEntity tx1 = db .beginStreamTransaction (null );
715
+ StreamTransactionEntity tx2 = db .beginStreamTransaction (null );
716
+
717
+ List <String > createdIds = Arrays .asList (tx1 .getId (), tx2 .getId ());
718
+ Set <TransactionEntity > gotTxs = db .getStreamTransactions ().stream ().
719
+ filter (it -> createdIds .contains (it .getId ())).collect (Collectors .toSet ());
720
+
721
+ assertThat (gotTxs .size (), is (createdIds .size ()));
722
+ assertThat (gotTxs .stream ()
723
+ .allMatch (it -> it .getStatus () == StreamTransactionStatus .running ), is (true ));
724
+
725
+ db .abortStreamTransaction (tx1 .getId ());
726
+ db .abortStreamTransaction (tx2 .getId ());
727
+ }
728
+
708
729
}
0 commit comments