Skip to content

Commit 9e21647

Browse files
committed
Bolt V4.x accepts database name
1 parent b8a340d commit 9e21647

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

driver/src/test/java/org/neo4j/driver/internal/messaging/v4/BoltProtocolV4Test.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,23 +306,19 @@ void databaseNameForAutoCommitTransactions()
306306
}
307307

308308
@Test
309-
@Disabled("Inspect why it's failing")
310-
void shouldNotSupportDatabaseNameInBeginTransaction()
309+
void shouldSupportDatabaseNameInBeginTransaction()
311310
{
312311
CompletionStage<Void> txStage = protocol.beginTransaction( connectionMock( "foo", protocol ), InternalBookmark.empty(), TransactionConfig.empty() );
313312

314-
ClientException e = assertThrows( ClientException.class, () -> await( txStage ) );
315-
assertThat( e.getMessage(), startsWith( "Database name parameter for selecting database is not supported" ) );
313+
assertDoesNotThrow( () -> await( txStage ) );
316314
}
317315

318316
@Test
319-
@Disabled("Inspect why it's failing")
320317
void shouldNotSupportDatabaseNameForAutoCommitTransactions()
321318
{
322-
ClientException e = assertThrows( ClientException.class,
319+
assertDoesNotThrow(
323320
() -> protocol.runInAutoCommitTransaction( connectionMock( "foo", protocol ),
324321
new Query( "RETURN 1" ), BookmarkHolder.NO_OP, TransactionConfig.empty(), true, UNLIMITED_FETCH_SIZE ) );
325-
assertThat( e.getMessage(), startsWith( "Database name parameter for selecting database is not supported" ) );
326322
}
327323

328324
private BoltProtocol createProtocol()

driver/src/test/java/org/neo4j/driver/internal/messaging/v41/BoltProtocolV41Test.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,23 +311,19 @@ void databaseNameForAutoCommitTransactions()
311311
}
312312

313313
@Test
314-
@Disabled("Inspect why it's failing")
315-
void shouldNotSupportDatabaseNameInBeginTransaction()
314+
void shouldSupportDatabaseNameInBeginTransaction()
316315
{
317316
CompletionStage<Void> txStage = protocol.beginTransaction( connectionMock( "foo", protocol ), InternalBookmark.empty(), TransactionConfig.empty() );
318317

319-
ClientException e = assertThrows( ClientException.class, () -> await( txStage ) );
320-
assertThat( e.getMessage(), startsWith( "Database name parameter for selecting database is not supported" ) );
318+
assertDoesNotThrow( () -> await( txStage ) );
321319
}
322320

323321
@Test
324-
@Disabled("Inspect why it's failing")
325322
void shouldNotSupportDatabaseNameForAutoCommitTransactions()
326323
{
327-
ClientException e = assertThrows( ClientException.class,
324+
assertDoesNotThrow(
328325
() -> protocol.runInAutoCommitTransaction( connectionMock( "foo", protocol ),
329-
new Query( "RETURN 1" ), BookmarkHolder.NO_OP, TransactionConfig.empty(), true, UNLIMITED_FETCH_SIZE ) );
330-
assertThat( e.getMessage(), startsWith( "Database name parameter for selecting database is not supported" ) );
326+
new Query( "RETURN 1" ), BookmarkHolder.NO_OP, TransactionConfig.empty(), true, UNLIMITED_FETCH_SIZE ) );
331327
}
332328

333329
private Class<? extends MessageFormat> expectedMessageFormatType()

driver/src/test/java/org/neo4j/driver/internal/messaging/v42/BoltProtocolV42Test.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,23 +312,19 @@ void databaseNameForAutoCommitTransactions()
312312
}
313313

314314
@Test
315-
@Disabled("Inspect why it's failing")
316-
void shouldNotSupportDatabaseNameInBeginTransaction()
315+
void shouldSupportDatabaseNameInBeginTransaction()
317316
{
318317
CompletionStage<Void> txStage = protocol.beginTransaction( connectionMock( "foo", protocol ), InternalBookmark.empty(), TransactionConfig.empty() );
319318

320-
ClientException e = assertThrows( ClientException.class, () -> await( txStage ) );
321-
assertThat( e.getMessage(), startsWith( "Database name parameter for selecting database is not supported" ) );
319+
assertDoesNotThrow( () -> await( txStage ) );
322320
}
323321

324322
@Test
325-
@Disabled("Inspect why it's failing")
326323
void shouldNotSupportDatabaseNameForAutoCommitTransactions()
327324
{
328-
ClientException e = assertThrows( ClientException.class,
325+
assertDoesNotThrow(
329326
() -> protocol.runInAutoCommitTransaction( connectionMock( "foo", protocol ),
330-
new Query( "RETURN 1" ), BookmarkHolder.NO_OP, TransactionConfig.empty(), true, UNLIMITED_FETCH_SIZE ) );
331-
assertThat( e.getMessage(), startsWith( "Database name parameter for selecting database is not supported" ) );
327+
new Query( "RETURN 1" ), BookmarkHolder.NO_OP, TransactionConfig.empty(), true, UNLIMITED_FETCH_SIZE ) );
332328
}
333329

334330
private Class<? extends MessageFormat> expectedMessageFormatType()

0 commit comments

Comments
 (0)