Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Neo4j enterprise edition definition in docs. #8149

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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>
```