BoltProtocolV3 implements BoltProtocol { @Override public CompletionStage<Void> rollbackTransaction( Connection connection ) { CompletableFuture<Void> rollbackFuture = new CompletableFuture<>(); connection.writeAndFlush( ROLLBACK, new RollbackTxResponseHandler( rollbackFuture ) ); return rollbackFuture; }  @Override MessageFormat createMessageFormat(); @Override void initializeChannel( String userAgent, AuthToken authToken, RoutingContext routingContext, ChannelPromise channelInitializedPromise ); @Override void prepareToCloseChannel( Channel channel ); @Override CompletionStage<Void> beginTransaction( Connection connection, Bookmark bookmark, TransactionConfig config ); @Override CompletionStage<Bookmark> commitTransaction( Connection connection ); @Override CompletionStage<Void> rollbackTransaction( Connection connection ); @Override ResultCursorFactory runInAutoCommitTransaction(Connection connection, Query query, BookmarkHolder bookmarkHolder,
                                                          TransactionConfig config, boolean waitForRunResponse, long fetchSize ); @Override ResultCursorFactory runInUnmanagedTransaction(Connection connection, Query query, UnmanagedTransaction tx,
                                                         boolean waitForRunResponse, long fetchSize ); @Override BoltProtocolVersion version(); static final BoltProtocolVersion VERSION; static final BoltProtocol INSTANCE; static final MetadataExtractor METADATA_EXTRACTOR; }
@Test void shouldRollbackTransaction() { Connection connection = connectionMock( protocol ); CompletionStage<Void> stage = protocol.rollbackTransaction( connection ); verify( connection ).writeAndFlush( eq( RollbackMessage.ROLLBACK ), any( RollbackTxResponseHandler.class ) ); assertNull( await( stage ) ); }