File tree Expand file tree Collapse file tree 5 files changed +9
-18
lines changed
testkit-backend/src/main/java/neo4j/org/testkit/backend Expand file tree Collapse file tree 5 files changed +9
-18
lines changed Original file line number Diff line number Diff line change 3030public class AsyncSessionState
3131{
3232 public AsyncSession session ;
33- public int retryableState ;
34- public String retryableErrorId ;
35- public CompletableFuture <Void > result ;
33+ public CompletableFuture <Void > txWorkFuture ;
3634
3735 public AsyncSessionState ( AsyncSession session )
3836 {
3937 this .session = session ;
40- this .retryableState = 0 ;
41- this .retryableErrorId = "" ;
4238 }
4339}
Original file line number Diff line number Diff line change @@ -55,15 +55,15 @@ public CompletionStage<Optional<TestkitResponse>> processAsync( TestkitState tes
5555 {
5656 AsyncSessionState sessionState = testkitState .getAsyncSessionStates ().get ( data .getSessionId () );
5757 Throwable throwable ;
58- if ( !"" .equals ( data .errorId ) )
58+ if ( !"" .equals ( data .getErrorId () ) )
5959 {
60- throwable = testkitState .getErrors ().get ( data .errorId );
60+ throwable = testkitState .getErrors ().get ( data .getErrorId () );
6161 }
6262 else
6363 {
6464 throwable = new RuntimeException ( "Error from client in retryable tx" );
6565 }
66- sessionState .getResult ().completeExceptionally ( throwable );
66+ sessionState .getTxWorkFuture ().completeExceptionally ( throwable );
6767 return CompletableFuture .completedFuture ( Optional .empty () );
6868 }
6969
Original file line number Diff line number Diff line change 2121import lombok .Getter ;
2222import lombok .NoArgsConstructor ;
2323import lombok .Setter ;
24- import neo4j .org .testkit .backend .AsyncSessionState ;
2524import neo4j .org .testkit .backend .SessionState ;
2625import neo4j .org .testkit .backend .TestkitState ;
2726import neo4j .org .testkit .backend .messages .responses .TestkitResponse ;
@@ -52,11 +51,7 @@ public TestkitResponse process( TestkitState testkitState )
5251 @ Override
5352 public CompletionStage <Optional <TestkitResponse >> processAsync ( TestkitState testkitState )
5453 {
55- AsyncSessionState sessionState = testkitState .getAsyncSessionStates ().get ( data .getSessionId () );
56- if ( sessionState != null )
57- {
58- sessionState .getResult ().complete ( null );
59- }
54+ testkitState .getAsyncSessionStates ().get ( data .getSessionId () ).getTxWorkFuture ().complete ( null );
6055 return CompletableFuture .completedFuture ( Optional .empty () );
6156 }
6257
Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ public CompletionStage<Optional<TestkitResponse>> processAsync( TestkitState tes
6767 String txId = testkitState .newId ();
6868 testkitState .getAsyncTransactions ().put ( txId , tx );
6969 testkitState .getResponseWriter ().accept ( retryableTry ( txId ) );
70- CompletableFuture <Void > tryResult = new CompletableFuture <>();
71- sessionState .setResult ( tryResult );
72- return tryResult ;
70+ CompletableFuture <Void > txWorkFuture = new CompletableFuture <>();
71+ sessionState .setTxWorkFuture ( txWorkFuture );
72+ return txWorkFuture ;
7373 };
7474
7575 return session .readTransactionAsync ( workWrapper )
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public CompletionStage<Optional<TestkitResponse>> processAsync( TestkitState tes
7070 testkitState .getAsyncTransactions ().put ( txId , tx );
7171 testkitState .getResponseWriter ().accept ( retryableTry ( txId ) );
7272 CompletableFuture <Void > tryResult = new CompletableFuture <>();
73- sessionState .setResult ( tryResult );
73+ sessionState .setTxWorkFuture ( tryResult );
7474 return tryResult ;
7575 };
7676
You can’t perform that action at this time.
0 commit comments