use of org.neo4j.driver.v1.exceptions.ServiceUnavailableException in project neo4j by neo4j.
the class BoltCausalClusteringIT method sessionCreationShouldFailIfCallingDiscoveryProcedureOnEdgeServer.
@Test
public void sessionCreationShouldFailIfCallingDiscoveryProcedureOnEdgeServer() throws Exception {
// given
cluster = clusterRule.withNumberOfReadReplicas(1).startCluster();
ReadReplica readReplica = cluster.getReadReplicaById(0);
try {
GraphDatabase.driver(readReplica.routingURI(), AuthTokens.basic("neo4j", "neo4j"));
fail("Should have thrown an exception using a read replica address for routing");
} catch (ServiceUnavailableException ex) {
// then
assertEquals(format("Server %s couldn't perform discovery", readReplica.boltAdvertisedAddress()), ex.getMessage());
}
}
Aggregations