This is an automated email from the ASF dual-hosted git repository.
Abacn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 5b9c5ba2b97 test: allow users to set custom Neo4j config (#40700)
5b9c5ba2b97 is described below
commit 5b9c5ba2b971d2d240bccae8d3a7adb92ebfb4df
Author: Florent Biville <[email protected]>
AuthorDate: Wed Oct 21 18:41:13 2026 +0200
test: allow users to set custom Neo4j config (#40700)
---
.../org/apache/beam/it/neo4j/Neo4jResourceManager.java | 18 +++++++++++++++++-
.../apache/beam/it/neo4j/Neo4jResourceManagerTest.java | 10 ++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git
a/it/neo4j/src/main/java/org/apache/beam/it/neo4j/Neo4jResourceManager.java
b/it/neo4j/src/main/java/org/apache/beam/it/neo4j/Neo4jResourceManager.java
index a8ee4053fc5..10e41c7fe92 100644
--- a/it/neo4j/src/main/java/org/apache/beam/it/neo4j/Neo4jResourceManager.java
+++ b/it/neo4j/src/main/java/org/apache/beam/it/neo4j/Neo4jResourceManager.java
@@ -23,6 +23,7 @@ import static
org.apache.beam.it.neo4j.Neo4jResourceManagerUtils.generateDatabas
import com.google.common.annotations.VisibleForTesting;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@@ -84,7 +85,7 @@ public class Neo4jResourceManager extends
TestContainerResourceManager<Neo4jCont
@VisibleForTesting
@SuppressWarnings("nullness")
Neo4jResourceManager(@Nullable Driver neo4jDriver, Neo4jContainer<?>
container, Builder builder) {
- super(container, builder);
+ super(withNeo4jConfig(container, builder.neo4jConfig), builder);
this.adminPassword = builder.adminPassword;
this.connectionString =
@@ -205,12 +206,22 @@ public class Neo4jResourceManager extends
TestContainerResourceManager<Neo4jCont
return adminPassword;
}
+ private static Neo4jContainer<?> withNeo4jConfig(
+ Neo4jContainer<?> container, Map<String, String> config) {
+ config.forEach(
+ (key, value) -> {
+ container.withNeo4jConfig(key, value);
+ });
+ return container;
+ }
+
/** Builder for {@link Neo4jResourceManager}. */
public static final class Builder
extends TestContainerResourceManager.Builder<Neo4jResourceManager> {
private @Nullable String databaseName;
private @Nullable DatabaseWaitOption waitOption;
+ private Map<String, String> neo4jConfig = new HashMap<>();
private String adminPassword;
@@ -266,6 +277,11 @@ public class Neo4jResourceManager extends
TestContainerResourceManager<Neo4jCont
return this;
}
+ public Builder addNeo4jConfig(String key, String value) {
+ neo4jConfig.put(key, value);
+ return this;
+ }
+
@VisibleForTesting
Builder setDriver(Driver driver) {
this.driver = driver;
diff --git
a/it/neo4j/src/test/java/org/apache/beam/it/neo4j/Neo4jResourceManagerTest.java
b/it/neo4j/src/test/java/org/apache/beam/it/neo4j/Neo4jResourceManagerTest.java
index 49d9c7ec232..f462b522a38 100644
---
a/it/neo4j/src/test/java/org/apache/beam/it/neo4j/Neo4jResourceManagerTest.java
+++
b/it/neo4j/src/test/java/org/apache/beam/it/neo4j/Neo4jResourceManagerTest.java
@@ -179,4 +179,14 @@ public class Neo4jResourceManagerTest {
assertThrows(Neo4jResourceManagerException.class, () ->
testManager.cleanupAll());
}
+
+ @Test
+ public void testSetsCustomNeo4jConfig() {
+ var builder =
+ Neo4jResourceManager.builder(TEST_ID)
+ .addNeo4jConfig("server.bolt.telemetry.enabled", "false");
+ new Neo4jResourceManager(neo4jDriver, container, builder);
+
+ verify(container).withNeo4jConfig("server.bolt.telemetry.enabled",
"false");
+ }
}