|
25 | 25 | import java.net.URI; |
26 | 26 |
|
27 | 27 | import org.neo4j.driver.internal.net.BoltServerAddress; |
| 28 | +import org.neo4j.driver.internal.util.ServerVersion; |
28 | 29 | import org.neo4j.driver.v1.Driver; |
29 | 30 | import org.neo4j.driver.v1.GraphDatabase; |
30 | 31 | import org.neo4j.driver.v1.Record; |
|
36 | 37 | import static org.hamcrest.core.IsEqual.equalTo; |
37 | 38 | import static org.junit.Assert.assertThat; |
38 | 39 | import static org.junit.Assert.fail; |
| 40 | +import static org.junit.Assume.assumeTrue; |
39 | 41 | import static org.neo4j.driver.internal.net.BoltServerAddress.LOCAL_DEFAULT; |
40 | 42 | import static org.neo4j.driver.internal.util.Matchers.directDriverWithAddress; |
41 | 43 | import static org.neo4j.driver.v1.Values.parameters; |
@@ -73,6 +75,8 @@ public void shouldUseDefaultPortIfMissing() |
73 | 75 | @Test |
74 | 76 | public void shouldAllowIPv6Address() |
75 | 77 | { |
| 78 | + assumeTrue( supportsListenAddressConfiguration( neo4j ) ); |
| 79 | + |
76 | 80 | // Given |
77 | 81 | URI uri = URI.create( "bolt://[::1]" ); |
78 | 82 | BoltServerAddress address = BoltServerAddress.from( uri ); |
@@ -140,4 +144,17 @@ public void shouldBeAbleRunCypher() throws Exception |
140 | 144 | // Finally |
141 | 145 | assertThat( server.exitStatus(), equalTo( 0 ) ); |
142 | 146 | } |
| 147 | + |
| 148 | + /** |
| 149 | + * Check if running test neo4j instance supports {@value org.neo4j.driver.v1.util.Neo4jSettings#LISTEN_ADDR} |
| 150 | + * configuration option. Only 3.1+ versions support it. |
| 151 | + * |
| 152 | + * @param neo4j the test neo4j instance to check. |
| 153 | + * @return {@code true} if given test neo4j supports config option, {@code false} otherwise. |
| 154 | + */ |
| 155 | + private static boolean supportsListenAddressConfiguration( TestNeo4j neo4j ) |
| 156 | + { |
| 157 | + ServerVersion version = ServerVersion.version( neo4j.driver() ); |
| 158 | + return version.greaterThanOrEqual( ServerVersion.v3_1_0 ); |
| 159 | + } |
143 | 160 | } |
0 commit comments