Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class Neo4jExampleTest {

@Container
private static Neo4jContainer<?> neo4jContainer = new Neo4jContainer<>(DockerImageName.parse("neo4j:4.4"))
private static Neo4jContainer neo4jContainer = new Neo4jContainer(DockerImageName.parse("neo4j:4.4"))
.withoutAuthentication(); // Disable password

@Test
Expand Down
3 changes: 2 additions & 1 deletion modules/neo4j/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {

tasks.japicmp {
classExcludes = [
"org.testcontainers.containers.Neo4jContainer"
"org.testcontainers.containers.Neo4jContainer",
"org.testcontainers.containers.Neo4jLabsPlugin"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* <li>HTTPS: 7473</li>
* </ul>
*/
public class Neo4jContainer<S extends Neo4jContainer<S>> extends GenericContainer<S> {
public class Neo4jContainer extends GenericContainer<Neo4jContainer> {

/**
* The image defaults to the official Neo4j image: <a href="https://hub.docker.com/_/neo4j/">Neo4j</a>.
Expand Down Expand Up @@ -205,7 +205,7 @@ public String getHttpsUrl() {
*
* @return This container.
*/
public S withEnterpriseEdition() {
public Neo4jContainer withEnterpriseEdition() {
if (!standardImage) {
throw new IllegalStateException(
String.format("Cannot use enterprise version with alternative image %s.", getDockerImageName())
Expand All @@ -227,7 +227,7 @@ public S withEnterpriseEdition() {
* @param adminPassword The admin password for the default database account.
* @return This container.
*/
public S withAdminPassword(final String adminPassword) {
public Neo4jContainer withAdminPassword(final String adminPassword) {
if (adminPassword != null && adminPassword.length() < 8) {
logger().warn("Your provided admin password is too short and will not work with Neo4j 5.3+.");
}
Expand All @@ -240,7 +240,7 @@ public S withAdminPassword(final String adminPassword) {
*
* @return This container.
*/
public S withoutAuthentication() {
public Neo4jContainer withoutAuthentication() {
return withAdminPassword(null);
}

Expand All @@ -264,7 +264,7 @@ public S withoutAuthentication() {
* @throws IllegalArgumentException If the database version is not 3.5.
* @return This container.
*/
public S withDatabase(MountableFile graphDb) {
public Neo4jContainer withDatabase(MountableFile graphDb) {
if (!isNeo4jDatabaseVersionSupportingDbCopy()) {
throw new IllegalArgumentException(
"Copying database folder is not supported for Neo4j instances with version 4.0 or higher."
Expand All @@ -283,7 +283,7 @@ public S withDatabase(MountableFile graphDb) {
* @param plugins
* @return This container.
*/
public S withPlugins(MountableFile plugins) {
public Neo4jContainer withPlugins(MountableFile plugins) {
return withCopyFileToContainer(plugins, "/var/lib/neo4j/plugins/");
}

Expand All @@ -295,7 +295,7 @@ public S withPlugins(MountableFile plugins) {
* @param value The value to set
* @return This container.
*/
public S withNeo4jConfig(String key, String value) {
public Neo4jContainer withNeo4jConfig(String key, String value) {
addEnv(formatConfigurationKey(key), value);
return self();
}
Expand All @@ -307,31 +307,6 @@ public String getAdminPassword() {
return adminPassword;
}

/**
* Registers one or more {@link Neo4jLabsPlugin} for download and server startup.
*
* @param neo4jLabsPlugins The Neo4j plugins that should get started with the server.
* @return This container.
* @deprecated {@link Neo4jLabsPlugin} were deprecated due to naming changes that cannot be solved by this enumeration.
* Please use the {@link Neo4jContainer#withPlugins(String...)} method.
*/
public S withLabsPlugins(Neo4jLabsPlugin... neo4jLabsPlugins) {
List<String> pluginNames = Arrays
.stream(neo4jLabsPlugins)
.map(plugin -> plugin.pluginName)
.collect(Collectors.toList());

this.labsPlugins.addAll(pluginNames);
return self();
}

/**
* @deprecated Please use {@link Neo4jContainer#withPlugins(String...)} for named plugins.
*/
public S withLabsPlugins(String... neo4jLabsPlugins) {
return this.withPlugins(neo4jLabsPlugins);
}

/**
* Registers one or more Neo4j plugins for server startup.
* The plugins are listed here
Expand All @@ -343,7 +318,7 @@ public S withLabsPlugins(String... neo4jLabsPlugins) {
* @param plugins The Neo4j plugins that should get started with the server.
* @return This container.
*/
public S withPlugins(String... plugins) {
public Neo4jContainer withPlugins(String... plugins) {
this.labsPlugins.addAll(Arrays.asList(plugins));
return self();
}
Expand Down Expand Up @@ -376,7 +351,7 @@ private boolean isNeo4jDatabaseVersionSupportingDbCopy() {
return false;
}

public S withRandomPassword() {
public Neo4jContainer withRandomPassword() {
return withAdminPassword(UUID.randomUUID().toString());
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class Neo4jContainerJUnitIntegrationTest {

@ClassRule
public static Neo4jContainer<?> neo4jContainer = new Neo4jContainer<>("neo4j:4.4");
public static Neo4jContainer neo4jContainer = new Neo4jContainer("neo4j:4.4");

@Test
public void shouldStart() {
Expand Down
Loading
Loading