Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Commit 6db5322

Browse files
GH-4 - Build now against 4.0.0-beta03 by default.
The docker image against which the integration tests run can now be select via system or environmental properties `SPRING_BOOT_STARTER_NEO4J_REPOSITORY` and `SPRING_BOOT_STARTER_NEO4J_VERSION`, where the environmental properties have precende over the system properties. The system properties defaults to `neo4j/neo4j-experimental:4.0.0-beta03mr03` via maven. If none set, we fallback to `neo4j:3.5.13` (for example when run via IDE).
1 parent 922c955 commit 6db5322

File tree

2 files changed

+52
-7
lines changed

2 files changed

+52
-7
lines changed

neo4j-java-driver-spring-boot-autoconfigure/src/test/java/org/neo4j/driver/springframework/boot/autoconfigure/Neo4jDriverAutoConfigurationIT.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
import java.util.Optional;
4444
import java.util.function.Predicate;
45+
import java.util.logging.Logger;
4546

4647
/**
4748
* @author Michael J. Simons
@@ -52,18 +53,33 @@
5253
class Neo4jDriverAutoConfigurationIT {
5354

5455
private static final String SYS_PROPERTY_NEO4J_ACCEPT_COMMERCIAL_EDITION = "SPRING_BOOT_STARTER_NEO4J_ACCEPT_COMMERCIAL_EDITION";
56+
private static final String SYS_PROPERTY_NEO4J_REPOSITORY = "SPRING_BOOT_STARTER_NEO4J_REPOSITORY";
5557
private static final String SYS_PROPERTY_NEO4J_VERSION = "SPRING_BOOT_STARTER_NEO4J_VERSION";
5658

5759
@Container
5860
private static Neo4jContainer neo4jServer;
61+
62+
private static final Logger LOGGER = Logger.getLogger(Neo4jDriverAutoConfigurationIT.class.getName());
63+
5964
static {
6065
Predicate<String> isNotBlank = s -> !s.trim().isEmpty();
61-
final String imageVersion = Optional.ofNullable(System.getenv(SYS_PROPERTY_NEO4J_VERSION))
62-
.filter(isNotBlank)
63-
.orElse("3.5.12");
64-
neo4jServer = new Neo4jContainer<>("neo4j:" + imageVersion)
66+
67+
String repository = Optional.ofNullable(System.getenv(SYS_PROPERTY_NEO4J_REPOSITORY))
68+
.filter(isNotBlank)
69+
.orElseGet(() -> System.getProperty(SYS_PROPERTY_NEO4J_REPOSITORY, "neo4j"));
70+
71+
String imageVersion = Optional.ofNullable(System.getenv(SYS_PROPERTY_NEO4J_VERSION))
72+
.filter(isNotBlank)
73+
.orElseGet(() -> System.getProperty(SYS_PROPERTY_NEO4J_VERSION, "3.5.13"));
74+
75+
String image = repository + ":" + imageVersion;
76+
LOGGER.info(() -> String.format("Using image %s", image));
77+
78+
neo4jServer = new Neo4jContainer<>(image)
6579
.withoutAuthentication()
66-
.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", Optional.ofNullable(System.getenv(SYS_PROPERTY_NEO4J_ACCEPT_COMMERCIAL_EDITION)).filter(isNotBlank).orElse("no"));
80+
.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT",
81+
Optional.ofNullable(System.getenv(SYS_PROPERTY_NEO4J_ACCEPT_COMMERCIAL_EDITION)).filter(isNotBlank)
82+
.orElse("no"));
6783
}
6884

6985

pom.xml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
100100
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
101101
<neo4j-java-driver.version>4.0.0-rc1</neo4j-java-driver.version>
102-
<neo4j.version>3.5.12</neo4j.version>
102+
<neo4j.repository>neo4j/neo4j-experimental</neo4j.repository>
103+
<neo4j.version>4.0.0-beta03mr03</neo4j.version>
103104
<revision>4.0</revision>
104105
<sha1></sha1>
105106
<sortpom-maven-plugin.version>2.8.0</sortpom-maven-plugin.version>
@@ -226,13 +227,29 @@
226227
<rules>
227228
<DependencyConvergence></DependencyConvergence>
228229
<requireMavenVersion>
229-
<version>3.6.0</version>
230+
<version>3.6.1</version>
230231
</requireMavenVersion>
231232
</rules>
232233
</configuration>
233234
</execution>
234235
</executions>
235236
</plugin>
237+
<plugin>
238+
<groupId>org.apache.maven.plugins</groupId>
239+
<artifactId>maven-surefire-plugin</artifactId>
240+
<configuration>
241+
<systemProperties>
242+
<property>
243+
<name>SPRING_BOOT_STARTER_NEO4J_REPOSITORY</name>
244+
<value>${neo4j.repository}</value>
245+
</property>
246+
<property>
247+
<name>SPRING_BOOT_STARTER_NEO4J_VERSION</name>
248+
<value>${neo4j.version}</value>
249+
</property>
250+
</systemProperties>
251+
</configuration>
252+
</plugin>
236253
<plugin>
237254
<groupId>org.apache.maven.plugins</groupId>
238255
<artifactId>maven-failsafe-plugin</artifactId>
@@ -244,6 +261,18 @@
244261
</goals>
245262
</execution>
246263
</executions>
264+
<configuration>
265+
<systemProperties>
266+
<property>
267+
<name>SPRING_BOOT_STARTER_NEO4J_REPOSITORY</name>
268+
<value>${neo4j.repository}</value>
269+
</property>
270+
<property>
271+
<name>SPRING_BOOT_STARTER_NEO4J_VERSION</name>
272+
<value>${neo4j.version}</value>
273+
</property>
274+
</systemProperties>
275+
</configuration>
247276
</plugin>
248277
<plugin>
249278
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)