@@ -2394,6 +2394,79 @@ describe('#stub-routing routing driver with stub server', () => {
23942394 } )
23952395 } )
23962396
2397+ describe ( 'should send address in routing context' , ( ) => {
2398+ async function verify ( version ) {
2399+ if ( ! boltStub . supported ) {
2400+ return
2401+ }
2402+
2403+ const router = await boltStub . start (
2404+ `./test/resources/boltstub/${ version } /acquire_endpoints_with_context.script` ,
2405+ 9001
2406+ )
2407+
2408+ const driver = boltStub . newDriver (
2409+ 'neo4j://127.0.0.1:9001/?policy=my_policy®ion=china'
2410+ )
2411+ const session = driver . session ( )
2412+ const result = await session . run ( 'MATCH (n) RETURN n.name AS name' )
2413+
2414+ await session . close ( )
2415+ await driver . close ( )
2416+ await router . exit ( )
2417+ }
2418+
2419+ it ( 'v4.1' , ( ) => verify ( 'v4.1' ) )
2420+ } )
2421+
2422+ describe ( 'should send routing context with hello to enable server routing' , ( ) => {
2423+ async function verify ( version ) {
2424+ if ( ! boltStub . supported ) {
2425+ return
2426+ }
2427+
2428+ const router = await boltStub . start (
2429+ `./test/resources/boltstub/${ version } /hello_routing_context.script` ,
2430+ 9001
2431+ )
2432+
2433+ const driver = boltStub . newDriver (
2434+ 'neo4j://127.0.0.1:9001/?policy=my_policy®ion=china'
2435+ )
2436+ const session = driver . session ( )
2437+ const result = await session . run ( 'MATCH (n) RETURN n.name' )
2438+
2439+ await session . close ( )
2440+ await driver . close ( )
2441+ await router . exit ( )
2442+ }
2443+
2444+ it ( 'v4.1' , ( ) => verify ( 'v4.1' ) )
2445+ } )
2446+
2447+ describe ( 'should send empty routing context with hello to enable server routing' , ( ) => {
2448+ async function verify ( version ) {
2449+ if ( ! boltStub . supported ) {
2450+ return
2451+ }
2452+
2453+ const router = await boltStub . start (
2454+ `./test/resources/boltstub/${ version } /hello_routing_enabled.script` ,
2455+ 9001
2456+ )
2457+
2458+ const driver = boltStub . newDriver ( 'neo4j://127.0.0.1:9001' )
2459+ const session = driver . session ( )
2460+ const result = await session . run ( 'MATCH (n) RETURN n.name' )
2461+
2462+ await session . close ( )
2463+ await driver . close ( )
2464+ await router . exit ( )
2465+ }
2466+
2467+ it ( 'v4.1' , ( ) => verify ( 'v4.1' ) )
2468+ } )
2469+
23972470 describe ( 'should report whether transaction config is supported' , ( ) => {
23982471 async function verifySupportsTransactionConfig ( version , expected ) {
23992472 if ( ! boltStub . supported ) {
0 commit comments