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

Commit aa01585

Browse files
Improve TestContainers setup.
1 parent 9fa3840 commit aa01585

File tree

6 files changed

+38
-28
lines changed

6 files changed

+38
-28
lines changed

examples/ogm-integration/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<!-- Change to 4.0.0 if needed and if on JDK 11 + -->
2222
<neo4j-ogm.version>3.2.21</neo4j-ogm.version>
2323
<neo4j.version>3.5.27</neo4j.version>
24-
<testcontainers.version>1.12.4</testcontainers.version>
24+
<testcontainers.version>1.15.2</testcontainers.version>
2525
</properties>
2626

2727
<dependencyManagement>

examples/ogm-integration/src/test/java/org/neo4j/doc/driver/springframework/boot/ogm_integration/ApplicationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.testcontainers.containers.Neo4jContainer;
3939
import org.testcontainers.junit.jupiter.Container;
4040
import org.testcontainers.junit.jupiter.Testcontainers;
41+
import org.testcontainers.utility.DockerImageName;
4142

4243
/**
4344
* This tests demonstrates that the automatic configuration for the driver integrates will with Spring Boot, meaning that
@@ -51,7 +52,8 @@
5152
public class ApplicationTest {
5253

5354
@Container
54-
private static final Neo4jContainer neo4jContainer = new Neo4jContainer<>();
55+
private static final Neo4jContainer neo4jContainer = new Neo4jContainer<>(DockerImageName.parse("neo4j").withTag("3.5.27"))
56+
.withReuse(true);
5557

5658
@Autowired
5759
private Driver driver;

examples/ogm-integration/src/test/java/org/neo4j/doc/driver/springframework/boot/ogm_integration/domain/TestSliceTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.testcontainers.containers.Neo4jContainer;
3636
import org.testcontainers.junit.jupiter.Container;
3737
import org.testcontainers.junit.jupiter.Testcontainers;
38+
import org.testcontainers.utility.DockerImageName;
3839

3940
/**
4041
* This tests shows that the Neo4j-OGM with the Java Driver autoconfiguration works fine with test slices.
@@ -48,7 +49,8 @@
4849
class TestSliceTest {
4950

5051
@Container
51-
private static final Neo4jContainer neo4jContainer = new Neo4jContainer<>();
52+
private static final Neo4jContainer neo4jContainer = new Neo4jContainer<>(DockerImageName.parse("neo4j").withTag("3.5.27"))
53+
.withReuse(true);
5254

5355
@Autowired
5456
private Driver driver;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ class Neo4jDriverAutoConfigurationIT {
7979
.withoutAuthentication()
8080
.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT",
8181
Optional.ofNullable(System.getenv(SYS_PROPERTY_NEO4J_ACCEPT_COMMERCIAL_EDITION)).filter(isNotBlank)
82-
.orElse("no"));
82+
.orElse("no"))
83+
.withReuse(true);
8384
}
8485

8586

neo4j-java-driver-test-harness-spring-boot-autoconfigure/pom.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717
| See the License for the specific language governing permissions and
1818
| limitations under the License.
1919
-->
20-
<project xmlns="http://maven.apache.org/POM/4.0.0"
21-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
2322
<parent>
2423
<artifactId>neo4j-java-driver-spring-boot-starter-parent</artifactId>
2524
<groupId>org.neo4j.driver</groupId>
2625
<version>${revision}${sha1}${changelist}</version>
2726
</parent>
28-
<modelVersion>4.0.0</modelVersion>
2927

3028
<artifactId>neo4j-java-driver-test-harness-spring-boot-autoconfigure</artifactId>
3129

@@ -80,4 +78,4 @@
8078
</plugin>
8179
</plugins>
8280
</build>
83-
</project>
81+
</project>

pom.xml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,14 @@
8686
</modules>
8787

8888
<properties>
89-
<asciidoctorj-diagram.version>2.0.1</asciidoctorj-diagram.version>
9089
<asciidoctor-maven-plugin.version>1.6.0</asciidoctor-maven-plugin.version>
90+
<asciidoctorj-diagram.version>2.0.1</asciidoctorj-diagram.version>
9191
<changelist>-SNAPSHOT</changelist>
9292
<checkstyle.version>8.29</checkstyle.version>
93-
<project.build.docs>${project.build.directory}/docs</project.build.docs>
9493
<flatten-maven-plugin.version>1.1.0</flatten-maven-plugin.version>
9594
<jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
9695
<java.version>1.8</java.version>
97-
<maven.version>3.6.1</maven.version>
96+
<jna.version>5.5.0</jna.version>
9897
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
9998
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
10099
<maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
@@ -104,17 +103,24 @@
104103
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
105104
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
106105
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
106+
<maven.version>3.6.1</maven.version>
107107
<neo4j-java-driver.version>4.2.4</neo4j-java-driver.version>
108108
<neo4j.repository>neo4j</neo4j.repository>
109109
<neo4j.version>4.2.4</neo4j.version>
110+
<project.build.docs>${project.build.directory}/docs</project.build.docs>
110111
<revision>4.0</revision>
111112
<sha1></sha1>
112113
<sortpom-maven-plugin.version>2.8.0</sortpom-maven-plugin.version>
113-
<testcontainers.version>1.12.4</testcontainers.version>
114+
<testcontainers.version>1.15.2</testcontainers.version>
114115
</properties>
115116

116117
<dependencyManagement>
117118
<dependencies>
119+
<dependency>
120+
<groupId>net.java.dev.jna</groupId>
121+
<artifactId>jna</artifactId>
122+
<version>${jna.version}</version>
123+
</dependency>
118124
<dependency>
119125
<groupId>org.neo4j.driver</groupId>
120126
<artifactId>neo4j-java-driver</artifactId>
@@ -125,9 +131,10 @@
125131
<artifactId>neo4j-harness</artifactId>
126132
<version>${neo4j.version}</version>
127133
<exclusions>
128-
<exclusion> <!-- Since 4.0.1 -->
129-
<groupId>org.slf4j</groupId>
134+
<exclusion>
130135
<artifactId>slf4j-nop</artifactId>
136+
<!-- Since 4.0.1 -->
137+
<groupId>org.slf4j</groupId>
131138
</exclusion>
132139
</exclusions>
133140
</dependency>
@@ -323,10 +330,6 @@
323330
<groupId>org.codehaus.mojo</groupId>
324331
<artifactId>flatten-maven-plugin</artifactId>
325332
<version>${flatten-maven-plugin.version}</version>
326-
<configuration>
327-
<updatePomFile>true</updatePomFile>
328-
<flattenMode>resolveCiFriendliesOnly</flattenMode>
329-
</configuration>
330333
<executions>
331334
<execution>
332335
<id>flatten</id>
@@ -343,11 +346,24 @@
343346
</goals>
344347
</execution>
345348
</executions>
349+
<configuration>
350+
<updatePomFile>true</updatePomFile>
351+
<flattenMode>resolveCiFriendliesOnly</flattenMode>
352+
</configuration>
346353
</plugin>
347354
<plugin>
348355
<groupId>org.asciidoctor</groupId>
349356
<artifactId>asciidoctor-maven-plugin</artifactId>
350357
<version>${asciidoctor-maven-plugin.version}</version>
358+
<executions>
359+
<execution>
360+
<id>generate-docs</id>
361+
<phase>prepare-package</phase>
362+
<goals>
363+
<goal>process-asciidoc</goal>
364+
</goals>
365+
</execution>
366+
</executions>
351367
<dependencies>
352368
<dependency>
353369
<groupId>org.asciidoctor</groupId>
@@ -374,15 +390,6 @@
374390
</requires>
375391
<outputDirectory>${project.build.docs}</outputDirectory>
376392
</configuration>
377-
<executions>
378-
<execution>
379-
<id>generate-docs</id>
380-
<phase>prepare-package</phase>
381-
<goals>
382-
<goal>process-asciidoc</goal>
383-
</goals>
384-
</execution>
385-
</executions>
386393
</plugin>
387394
</plugins>
388395
</build>

0 commit comments

Comments
 (0)