S
- "SELF" to be used in the withXXX
methods.public class Neo4jContainer<S extends Neo4jContainer<S>>
extends org.testcontainers.containers.GenericContainer<S>
Constructor and Description |
---|
Neo4jContainer()
Creates a Testcontainer using the official Neo4j docker image.
|
Neo4jContainer(java.lang.String dockerImageName)
Creates a Testcontainer using a specific docker image.
|
Modifier and Type | Method and Description |
---|---|
protected void |
configure() |
java.lang.String |
getAdminPassword() |
java.lang.String |
getBoltUrl() |
java.lang.String |
getHttpsUrl() |
java.lang.String |
getHttpUrl() |
java.util.Set<java.lang.Integer> |
getLivenessCheckPortNumbers() |
S |
withAdminPassword(java.lang.String adminPassword)
Sets the admin password for the default account (which is
|
S |
withDatabase(org.testcontainers.utility.MountableFile graphDb)
Copies an existing
graph.db folder into the container. |
S |
withEnterpriseEdition()
Configures the container to use the enterprise edition of the default docker image.
|
S |
withNeo4jConfig(java.lang.String key,
java.lang.String value)
Adds Neo4j configuration properties to the container.
|
S |
withoutAuthentication()
Disables authentication.
|
S |
withPlugins(org.testcontainers.utility.MountableFile plugins)
Adds plugins to the given directory to the container.
|
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canEqual, containerIsCreated, containerIsStarted, containerIsStarting, copyFileFromContainer, copyFileFromContainer, copyFileToContainer, copyFileToContainer, createVolumeDirectory, doStart, equals, execInContainer, execInContainer, failed, fetchDockerDaemonInfo, finished, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDockerClient, getDockerDaemonInfo, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isPrivilegedMode, logger, setBinds, setCommand, setCommand, setCommandParts, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, stop, succeeded, toString, waitingFor, waitUntilContainerStarted, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectory
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind
public Neo4jContainer()
public Neo4jContainer(java.lang.String dockerImageName)
dockerImageName
- The docker image to use.public java.util.Set<java.lang.Integer> getLivenessCheckPortNumbers()
getLivenessCheckPortNumbers
in interface org.testcontainers.containers.wait.strategy.WaitStrategyTarget
getLivenessCheckPortNumbers
in class org.testcontainers.containers.GenericContainer<S extends Neo4jContainer<S>>
protected void configure()
configure
in class org.testcontainers.containers.GenericContainer<S extends Neo4jContainer<S>>
public java.lang.String getBoltUrl()
public java.lang.String getHttpUrl()
public java.lang.String getHttpsUrl()
public S withEnterpriseEdition()
public S withAdminPassword(java.lang.String adminPassword)
neo4j). A null value or an empty string disables authentication.
adminPassword
- The admin password for the default database account.public S withoutAuthentication()
public S withDatabase(org.testcontainers.utility.MountableFile graphDb)
graph.db
folder into the container. This can either be a classpath resource or a
host resource. Please have a look at the factory methods in MountableFile
.
#withClasspathResourceMapping
,
but this will only work when your test does not run in a container itself.
@Container private static final Neo4jContainer databaseServer = new Neo4jContainer<>() .withClasspathResourceMapping("/test-graph.db", "/data/databases/graph.db", BindMode.READ_WRITE);
graphDb
- The graph.db folder to copy into the containerpublic S withPlugins(org.testcontainers.utility.MountableFile plugins)
plugins
denotes a directory, than all of that
directory is mapped to Neo4j's plugins. Otherwise, single resources are copied over.
#withClasspathResourceMapping
,
but this will only work when your test does not run in a container itself.plugins
- public S withNeo4jConfig(java.lang.String key, java.lang.String value)
key
- The key to configure, i.e. dbms.security.procedures.unrestricted
value
- The value to setpublic java.lang.String getAdminPassword()
neo4j
account or literal null
if auth is disabled.