Struct testcontainers_modules::neo4j::Neo4j
source · pub struct Neo4j { /* private fields */ }neo4j only.Expand description
Neo4j image for testcontainers.
This image is based on the official Neo4j image.
The default user is neo4j and the default password is neo.
The default version is 5.
Example
use testcontainers::clients::Cli;
use testcontainers_modules::neo4j::Neo4j;
let cli = Cli::default();
let container = cli.run(Neo4j::default());
let uri = format!("bolt://localhost:{}", container.image().bolt_port_ipv4());
let auth_user = container.image().user();
let auth_pass = container.image().password();
// connect to Neo4j with the uri, user and passNeo4j Version
The version of the image can be set with the NEO4J_VERSION_TAG environment variable.
The default version is 5.
The available versions can be found on Docker Hub.
The used version can be retrieved with the version method.
Auth
The default user is neo4j and the default password is neo.
The used user can be retrieved with the user method.
The used password can be retrieved with the pass method.
Environment variables
The following environment variables are supported:
NEO4J_VERSION_TAG: The default version of the image to use.NEO4J_TEST_USER: The default user to use for authentication.NEO4J_TEST_PASS: The default password to use for authentication.
Neo4j Labs Plugins
Neo4j offers built-in support for Neo4j Labs plugins.
The method with_neo4j_labs_plugin can be used to define them.
Supported plugins are APOC, APOC Core, Bloom, Streams, Graph Data Science, and Neo Semantics.
Implementations§
source§impl Neo4j
impl Neo4j
sourcepub fn with_version(self, version: impl Into<Cow<'static, str>>) -> Self
pub fn with_version(self, version: impl Into<Cow<'static, str>>) -> Self
Set the Neo4j version to use. The value must be an existing Neo4j version tag.
sourcepub fn with_password(self, pass: impl Into<Cow<'static, str>>) -> Self
pub fn with_password(self, pass: impl Into<Cow<'static, str>>) -> Self
Set the password to use.
sourcepub fn without_authentication(self) -> Self
pub fn without_authentication(self) -> Self
Do not use any authentication on the testcontainer.
Setting this will override any prior usages of Self::with_user and
Self::with_password.
sourcepub fn with_neo4j_labs_plugin(self, plugins: &[Neo4jLabsPlugin]) -> Self
pub fn with_neo4j_labs_plugin(self, plugins: &[Neo4jLabsPlugin]) -> Self
Add Neo4j lab plugins to get started with the database.