Package org.testcontainers.containers
Class Neo4jContainer<S extends Neo4jContainer<S>>
java.lang.Object
org.testcontainers.containers.GenericContainer<S>
org.testcontainers.containers.Neo4jContainer<S>
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.containers.Container<S>,org.testcontainers.containers.ContainerState,org.testcontainers.containers.traits.LinkableContainer,org.testcontainers.containers.wait.strategy.WaitStrategyTarget,org.testcontainers.lifecycle.Startable
@Deprecated
public class Neo4jContainer<S extends Neo4jContainer<S>>
extends org.testcontainers.containers.GenericContainer<S>
Deprecated.
Testcontainers implementation for Neo4j.
Supported image: neo4j
Exposed ports:
- Bolt: 7687
- HTTP: 7474
- HTTPS: 7473
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.testcontainers.containers.wait.strategy.WaitStrategyDeprecated.Default wait strategiesFields inherited from class org.testcontainers.containers.GenericContainer
CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategyFields inherited from interface org.testcontainers.containers.ContainerState
STATE_HEALTHY -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.useNeo4jContainer(DockerImageName)insteadNeo4jContainer(String dockerImageName) Deprecated.Creates a Neo4jContainer using a specific docker image.Neo4jContainer(org.testcontainers.utility.DockerImageName dockerImageName) Deprecated.Creates a Neo4jContainer using a specific docker image. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.withAdminPassword(String adminPassword) Deprecated.Sets the admin password for the default account (which iswithDatabase(org.testcontainers.utility.MountableFile graphDb) Deprecated.Copies an existinggraph.dbfolder into the container.Deprecated.Configures the container to use the enterprise edition of the default docker image.withNeo4jConfig(String key, String value) Deprecated.Adds Neo4j configuration properties to the container.Deprecated.Disables authentication.withPlugins(String... plugins) Deprecated.Registers one or more Neo4j plugins for server startup.withPlugins(org.testcontainers.utility.MountableFile plugins) Deprecated.Adds plugins to the given directory to the container.Deprecated.Methods inherited from class org.testcontainers.containers.GenericContainer
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, 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, stop, 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, withWorkingDirectoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.testcontainers.containers.Container
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindMethods inherited from interface org.testcontainers.containers.ContainerState
copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunningMethods inherited from interface org.testcontainers.lifecycle.Startable
close
-
Field Details
-
WAIT_FOR_BOLT
public static final org.testcontainers.containers.wait.strategy.WaitStrategy WAIT_FOR_BOLTDeprecated.Default wait strategies
-
-
Constructor Details
-
Neo4jContainer
Deprecated.useNeo4jContainer(DockerImageName)insteadCreates a Neo4jContainer using the official Neo4j docker image. -
Neo4jContainer
Deprecated.Creates a Neo4jContainer using a specific docker image.- Parameters:
dockerImageName- The docker image to use.
-
Neo4jContainer
public Neo4jContainer(org.testcontainers.utility.DockerImageName dockerImageName) Deprecated.Creates a Neo4jContainer using a specific docker image.- Parameters:
dockerImageName- The docker image to use.
-
-
Method Details
-
getLivenessCheckPortNumbers
Deprecated.- Specified by:
getLivenessCheckPortNumbersin interfaceorg.testcontainers.containers.wait.strategy.WaitStrategyTarget- Overrides:
getLivenessCheckPortNumbersin classorg.testcontainers.containers.GenericContainer<S extends Neo4jContainer<S>>
-
configure
protected void configure()Deprecated.- Overrides:
configurein classorg.testcontainers.containers.GenericContainer<S extends Neo4jContainer<S>>
-
getBoltUrl
Deprecated.- Returns:
- Bolt URL for use with Neo4j's Java-Driver.
-
getHttpUrl
Deprecated.- Returns:
- URL of the transactional HTTP endpoint.
-
getHttpsUrl
Deprecated.- Returns:
- URL of the transactional HTTPS endpoint.
-
withEnterpriseEdition
Deprecated.Configures the container to use the enterprise edition of the default docker image.
Please have a look at the Neo4j Licensing page. While the Neo4j Community Edition can be used for free in your projects under the GPL v3 license, Neo4j Enterprise edition needs either a commercial, education or evaluation license.- Returns:
- This container.
-
withAdminPassword
Deprecated.Sets the admin password for the default account (which isneo4j
). A null value or an empty string disables authentication.- Parameters:
adminPassword- The admin password for the default database account.- Returns:
- This container.
-
withoutAuthentication
Deprecated.Disables authentication.- Returns:
- This container.
-
withDatabase
Deprecated.Copies an existinggraph.dbfolder into the container. This can either be a classpath resource or a host resource. Please have a look at the factory methods inMountableFile.
If you want to map your database into the container instead of copying them, please use#withClasspathResourceMapping, but this will only work when your test does not run in a container itself.
Note: This method only works with Neo4j 3.5.
Mapping would work like this:@Container private static final Neo4jContainer databaseServer = new Neo4jContainer<>() .withClasspathResourceMapping("/test-graph.db", "/data/databases/graph.db", BindMode.READ_WRITE);- Parameters:
graphDb- The graph.db folder to copy into the container- Returns:
- This container.
- Throws:
IllegalArgumentException- If the database version is not 3.5.
-
withPlugins
Deprecated.Adds plugins to the given directory to the container. Ifpluginsdenotes a directory, than all of that directory is mapped to Neo4j's plugins. Otherwise, single resources are copied over.
If you want to map your plugins into the container instead of copying them, please use#withClasspathResourceMapping, but this will only work when your test does not run in a container itself.- Parameters:
plugins-- Returns:
- This container.
-
withNeo4jConfig
Deprecated.Adds Neo4j configuration properties to the container. The properties can be added as in the official Neo4j configuration, the method automatically translate them into the format required by the Neo4j container.- Parameters:
key- The key to configure, i.e.dbms.security.procedures.unrestrictedvalue- The value to set- Returns:
- This container.
-
getAdminPassword
Deprecated.- Returns:
- The admin password for the
neo4jaccount or literalnullif auth is disabled.
-
withPlugins
Deprecated.Registers one or more Neo4j plugins for server startup. The plugins are listed here- Parameters:
plugins- The Neo4j plugins that should get started with the server.- Returns:
- This container.
-
withRandomPassword
Deprecated.
-
Neo4jContainerinstead.