BoltProtocolV3 implements BoltProtocol { @Override public ResultCursorFactory runInAutoCommitTransaction(Connection connection, Query query, BookmarkHolder bookmarkHolder, TransactionConfig config, boolean waitForRunResponse, long fetchSize ) { verifyDatabaseNameBeforeTransaction( connection.databaseName() ); RunWithMetadataMessage runMessage = autoCommitTxRunMessage(query, config, connection.databaseName(), connection.mode(), bookmarkHolder.getBookmark() ); return buildResultCursorFactory( connection, query, bookmarkHolder, null, runMessage, waitForRunResponse, fetchSize ); }  @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 shouldNotSupportDatabaseNameForAutoCommitTransactions() { ClientException e = assertThrows( ClientException.class, () -> protocol.runInAutoCommitTransaction( connectionMock( "foo", protocol ), new Query( "RETURN 1" ), BookmarkHolder.NO_OP, TransactionConfig.empty(), true, UNLIMITED_FETCH_SIZE ) ); assertThat( e.getMessage(), startsWith( "Database name parameter for selecting database is not supported" ) ); }