Skip to content

Commit 56660cf

Browse files
authored
Correct examples for Config. Use example.com for URIs (#735) (#739)
1 parent 233e0e4 commit 56660cf

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

driver/src/main/java/org/neo4j/driver/Config.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,22 @@
5050
* To build a simple config with custom logging implementation:
5151
* <pre>
5252
* {@code
53-
* Config config = Config
54-
* .build()
55-
* .withLogging(new MyLogging())
56-
* .toConfig();
53+
* Config config = Config.builder()
54+
* .withLogging(new MyLogging())
55+
* .build();
5756
* }
5857
* </pre>
5958
* <p>
6059
* To build a more complicated config with tuned connection pool options:
6160
* <pre>
6261
* {@code
63-
* Config config = Config.build()
64-
* .withEncryption()
65-
* .withConnectionTimeout(10, TimeUnit.SECONDS)
66-
* .withMaxConnectionLifetime(30, TimeUnit.MINUTES)
67-
* .withMaxConnectionPoolSize(10)
68-
* .withConnectionAcquisitionTimeout(20, TimeUnit.SECONDS)
69-
* .toConfig();
62+
* Config config = Config.builder()
63+
* .withEncryption()
64+
* .withConnectionTimeout( 10, TimeUnit.SECONDS)
65+
* .withMaxConnectionLifetime(30, TimeUnit.MINUTES)
66+
* .withMaxConnectionPoolSize(10)
67+
* .withConnectionAcquisitionTimeout(20, TimeUnit.SECONDS)
68+
* .build();
7069
* }
7170
* </pre>
7271
*

examples/src/main/java/org/neo4j/docs/driver/ConfigCustomResolverExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ private void addPerson( String name )
6262
String username = "neo4j";
6363
String password = "some password";
6464

65-
try ( Driver driver = createDriver( "neo4j://x.acme.com", username, password, ServerAddress.of( "a.acme.com", 7676 ),
66-
ServerAddress.of( "b.acme.com", 8787 ), ServerAddress.of( "c.acme.com", 9898 ) ) )
65+
try ( Driver driver = createDriver( "neo4j://x.example.com", username, password, ServerAddress.of( "a.example.com", 7676 ),
66+
ServerAddress.of( "b.example.com", 8787 ), ServerAddress.of( "c.example.com", 9898 ) ) )
6767
{
6868
try ( Session session = driver.session( builder().withDefaultAccessMode( AccessMode.WRITE ).build() ) )
6969
{

examples/src/test/java/org/neo4j/docs/driver/ExamplesStubIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void testShouldRunConfigCustomResolverExample() throws Exception
3535
StubServer server2 = StubServer.start( "return_1.script", 9002 );
3636

3737
// Given
38-
try ( ConfigCustomResolverExample example = new ConfigCustomResolverExample( "neo4j://x.acme.com", ServerAddress.of( "localhost", 9001 ) ) )
38+
try ( ConfigCustomResolverExample example = new ConfigCustomResolverExample( "neo4j://x.example.com", ServerAddress.of( "localhost", 9001 ) ) )
3939
{
4040
// Then
4141
assertTrue( example.canConnect() );

examples/src/test/resources/get_routing_table_only.script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
!: AUTO HELLO
44
!: AUTO GOODBYE
55

6-
C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": { "address": "x.acme.com:7687" }} {}
6+
C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": { "address": "x.example.com:7687" }} {}
77
PULL_ALL
88
S: SUCCESS {"fields": ["ttl", "servers"]}
99
RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001"], "role": "ROUTE"}]]

0 commit comments

Comments
 (0)