19
19
package org .neo4j .driver .integration ;
20
20
21
21
import static java .time .Duration .ofMillis ;
22
- import static java .util .Arrays .asList ;
23
22
import static org .hamcrest .MatcherAssert .assertThat ;
24
23
import static org .hamcrest .Matchers .containsString ;
25
24
import static org .hamcrest .Matchers .greaterThan ;
@@ -78,13 +77,13 @@ void shouldSetTransactionMetadata() {
78
77
Map <String , Object > metadata = new HashMap <>();
79
78
metadata .put ("a" , "hello world" );
80
79
metadata .put ("b" , LocalDate .now ());
81
- metadata .put ("c" , asList ( true , false , true ) );
80
+ metadata .put ("c" , false );
82
81
83
82
TransactionConfig config =
84
83
TransactionConfig .builder ().withMetadata (metadata ).build ();
85
84
86
85
// call listTransactions procedure that should list itself with the specified metadata
87
- Result result = driver .session ().run ("CALL dbms.listTransactions() " , config );
86
+ Result result = driver .session ().run ("SHOW TRANSACTIONS YIELD metaData " , config );
88
87
Map <String , Object > receivedMetadata = result .single ().get ("metaData" ).asMap ();
89
88
90
89
assertEquals (metadata , receivedMetadata );
@@ -101,7 +100,7 @@ void shouldSetTransactionMetadataAsync() {
101
100
102
101
// call listTransactions procedure that should list itself with the specified metadata
103
102
CompletionStage <Map <String , Object >> metadataFuture = driver .asyncSession ()
104
- .runAsync ("CALL dbms.listTransactions() " , config )
103
+ .runAsync ("SHOW TRANSACTIONS YIELD metaData " , config )
105
104
.thenCompose (ResultCursor ::singleAsync )
106
105
.thenApply (record -> record .get ("metaData" ).asMap ());
107
106
@@ -312,10 +311,10 @@ private static void testTransactionMetadataWithAsyncTransactionFunctions(boolean
312
311
// call listTransactions procedure that should list itself with the specified metadata
313
312
CompletionStage <Record > singleFuture = read
314
313
? asyncSession .readTransactionAsync (
315
- tx -> tx .runAsync ("CALL dbms.listTransactions() " ).thenCompose (ResultCursor ::singleAsync ),
314
+ tx -> tx .runAsync ("SHOW TRANSACTIONS YIELD metaData " ).thenCompose (ResultCursor ::singleAsync ),
316
315
config )
317
316
: asyncSession .writeTransactionAsync (
318
- tx -> tx .runAsync ("CALL dbms.listTransactions() " ).thenCompose (ResultCursor ::singleAsync ),
317
+ tx -> tx .runAsync ("SHOW TRANSACTIONS YIELD metaData " ).thenCompose (ResultCursor ::singleAsync ),
319
318
config );
320
319
321
320
CompletionStage <Map <String , Object >> metadataFuture =
@@ -337,9 +336,9 @@ private static void testTransactionMetadataWithTransactionFunctions(boolean read
337
336
// call listTransactions procedure that should list itself with the specified metadata
338
337
Record single = read
339
338
? session .readTransaction (
340
- tx -> tx .run ("CALL dbms.listTransactions() " ).single (), config )
339
+ tx -> tx .run ("SHOW TRANSACTIONS YIELD metaData " ).single (), config )
341
340
: session .writeTransaction (
342
- tx -> tx .run ("CALL dbms.listTransactions() " ).single (), config );
341
+ tx -> tx .run ("SHOW TRANSACTIONS YIELD metaData " ).single (), config );
343
342
344
343
Map <String , Object > receivedMetadata = single .get ("metaData" ).asMap ();
345
344
0 commit comments