Skip to content

Commit

Permalink
Clarify Neo4j enterprise edition definition in docs (#8149)
Browse files Browse the repository at this point in the history
  • Loading branch information
meistermeier committed Jan 24, 2024
1 parent afc94f1 commit 2e829ba
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions docs/modules/databases/neo4j.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Neo4j Module

This module helps running [Neo4j](https://neo4j.com/download/) using Testcontainers.
This module helps to run [Neo4j](https://neo4j.com/download/) using Testcontainers.

Note that it's based on the [official Docker image](https://hub.docker.com/_/neo4j/) provided by Neo4j, Inc.

Even though the latest LTS version of Neo4j 4.4 is used in the examples of this documentation,
the Testcontainers integration supports also newer 5.x images of Neo4j.

## Usage example

Declare your Testcontainers as a `@ClassRule` or `@Rule` in a JUnit 4 test or as static or member attribute of a JUnit 5 test annotated with `@Container` as you would with other Testcontainers.
Expand All @@ -17,7 +20,7 @@ The following example uses the JUnit 5 extension `@Testcontainers` and demonstra
[JUnit 5 example](../../../examples/neo4j-container/src/test/java/org/testcontainers/containers/Neo4jExampleTest.java) inside_block:junitExample
<!--/codeinclude-->

You are not limited to Unit tests and can of course use an instance of the Neo4j Testcontainers in vanilla Java code as well.
You are not limited to Unit tests, and you can use an instance of the Neo4j Testcontainers in vanilla Java code as well.

## Additional features

Expand Down Expand Up @@ -102,9 +105,13 @@ If you need the Neo4j enterprise license, you can declare your Neo4j container l
[Enterprise edition](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:enterpriseEdition
<!--/codeinclude-->

This creates a Testcontainers based on the Docker image build with the Enterprise version of Neo4j.
This creates a Testcontainers based on the Docker image build with the Enterprise version of Neo4j 4.4.
The call to `withEnterpriseEdition` adds the required environment variable that you accepted the terms and condition of the enterprise version.
You accept those by adding a file named `container-license-acceptance.txt` to the root of your classpath containing the text `neo4j:3.5.0-enterprise` in one line.
You accept those by adding a file named `container-license-acceptance.txt` to the root of your classpath containing the text `neo4j:4.4-enterprise` in one line.

If you are planning to run a newer Neo4j 5.x enterprise edition image, you have to manually define the proper enterprise image (e.g. `neo4j:5-enterprise`)
and set the environment variable `NEO4J_ACCEPT_LICENSE_AGREEMENT` by adding `.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", "yes")` to your container definition.

You'll find more information about licensing Neo4j here: [About Neo4j Licenses](https://neo4j.com/licensing/).


Expand All @@ -131,14 +138,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:

=== "Gradle"
```groovy
compile "org.neo4j.driver:neo4j-java-driver:4.4.3"
compile "org.neo4j.driver:neo4j-java-driver:4.4.13"
```

=== "Maven"
```xml
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>4.4.3</version>
<version>4.4.13</version>
</dependency>
```

0 comments on commit 2e829ba

Please sign in to comment.