public class Neo4jContainer<S extends Neo4jContainer<S>>
extends org.testcontainers.containers.GenericContainer<S>
Supported image: neo4j
Exposed ports:
Modifier and Type | Field and Description |
---|---|
static org.testcontainers.containers.wait.strategy.WaitStrategy |
WAIT_FOR_BOLT
Default wait strategies
|
Constructor and Description |
---|
Neo4jContainer()
Deprecated.
use
Neo4jContainer(DockerImageName) instead |
Neo4jContainer(org.testcontainers.utility.DockerImageName dockerImageName)
Creates a Neo4jContainer using a specific docker image.
|
Neo4jContainer(java.lang.String dockerImageName)
Creates a Neo4jContainer 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 |
withLabsPlugins(Neo4jLabsPlugin... neo4jLabsPlugins)
Deprecated.
Neo4jLabsPlugin were deprecated due to naming changes that cannot be solved by this enumeration.
Please use the withPlugins(String...) method. |
S |
withLabsPlugins(java.lang.String... neo4jLabsPlugins)
Deprecated.
Please use
withPlugins(String...) for named plugins. |
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.
|
S |
withPlugins(java.lang.String... plugins)
Registers one or more Neo4j plugins for server startup.
|
S |
withRandomPassword() |
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, failed, finished, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, 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, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, stop, succeeded, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectory
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind
copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning
public static final org.testcontainers.containers.wait.strategy.WaitStrategy WAIT_FOR_BOLT
@Deprecated public Neo4jContainer()
Neo4jContainer(DockerImageName)
insteadpublic Neo4jContainer(java.lang.String dockerImageName)
dockerImageName
- The docker image to use.public Neo4jContainer(org.testcontainers.utility.DockerImageName 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 containerjava.lang.IllegalArgumentException
- If the database version is not 3.5.public 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.public S withLabsPlugins(Neo4jLabsPlugin... neo4jLabsPlugins)
Neo4jLabsPlugin
were deprecated due to naming changes that cannot be solved by this enumeration.
Please use the withPlugins(String...)
method.Neo4jLabsPlugin
for download and server startup.neo4jLabsPlugins
- The Neo4j plugins that should get started with the server.public S withLabsPlugins(java.lang.String... neo4jLabsPlugins)
withPlugins(String...)
for named plugins.public S withPlugins(java.lang.String... plugins)
plugins
- The Neo4j plugins that should get started with the server.public S withRandomPassword()