Skip to content

Commit 47db433

Browse files
authored
Stub tests migration part 4 (neo4j#847)
Removed RoutingDriverMultidatabaseBoltKitIT Migrated tests: - shouldDiscoverForDatabase -> test_should_read_successfully_from_reader_using_session_run (this tests seems to cover the same use-case and uses a non-default DB for 4+ versions) - shouldRetryOnEmptyDiscoveryResult -> test_should_read_successfully_on_empty_discovery_result_using_session_run - shouldThrowRoutingErrorIfDatabaseNotFound -> test_should_fail_with_routing_failure_on_db_not_found_discovery_failure - shouldBeAbleToServeReachableDatabase -> test_should_read_successfully_from_reachable_db_after_trying_unreachable_db (message check has been removed) - shouldPassSystemBookmarkWhenGettingRoutingTableForMultiDB -> test_should_pass_system_bookmark_when_getting_rt_for_multi_db (seems to be applicable to V4 only, also the stub server doesn't seem to check bookmarks) - shouldIgnoreSystemBookmarkWhenGettingRoutingTable -> test_should_ignore_system_bookmark_when_getting_rt_for_multi_db - shouldDriverVerifyConnectivity -> test_should_successfully_get_routing_table_with_context (pre-existing test that already tests the connectivity) Also removed redundant scripts and added code support to DriverError
1 parent e780740 commit 47db433

12 files changed

+9
-346
lines changed

driver/src/test/java/org/neo4j/driver/integration/RoutingDriverMultidatabaseBoltKitIT.java

Lines changed: 0 additions & 242 deletions
This file was deleted.

driver/src/test/resources/acquire_endpoints_v4.script

Lines changed: 0 additions & 10 deletions
This file was deleted.

driver/src/test/resources/acquire_endpoints_v4_database_not_found.script

Lines changed: 0 additions & 9 deletions
This file was deleted.

driver/src/test/resources/acquire_endpoints_v4_empty.script

Lines changed: 0 additions & 10 deletions
This file was deleted.

driver/src/test/resources/acquire_endpoints_v4_multi_db.script

Lines changed: 0 additions & 15 deletions
This file was deleted.

driver/src/test/resources/acquire_endpoints_v4_verify_connectivity.script

Lines changed: 0 additions & 15 deletions
This file was deleted.

driver/src/test/resources/acquire_endpoints_v4_virtual_host.script

Lines changed: 0 additions & 10 deletions
This file was deleted.

driver/src/test/resources/acquire_endpoints_v4_with_bookmark.script

Lines changed: 0 additions & 10 deletions
This file was deleted.

driver/src/test/resources/read_server_v3_read_with_bookmark.script

Lines changed: 0 additions & 12 deletions
This file was deleted.

driver/src/test/resources/read_server_v4_read_with_bookmark.script

Lines changed: 0 additions & 12 deletions
This file was deleted.

testkit-backend/src/main/java/neo4j/org/testkit/backend/CommandProcessor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,13 @@ else if ( currentLine.equals( "#request end" ) )
175175

176176
private DriverError driverError( String id, Neo4jException e )
177177
{
178-
return DriverError.builder().data( DriverError.DriverErrorBody.builder().id( id ).errorType( e.getClass().getName() ).build() ).build();
178+
return DriverError.builder().data(
179+
DriverError.DriverErrorBody.builder()
180+
.id( id )
181+
.errorType( e.getClass().getName() )
182+
.code( e.code() )
183+
.build() )
184+
.build();
179185
}
180186

181187
public void processRequest( String request )

testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/DriverError.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@ public static class DriverErrorBody
4343
private String id;
4444

4545
private String errorType;
46+
47+
private String code;
4648
}
4749
}

0 commit comments

Comments
 (0)