Skip to content

Commit 290eb23

Browse files
authored
test: update test image (#165)
1 parent db0f2b9 commit 290eb23

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

src/test/java/org/neo4j/cdc/client/CDCClientIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
@Testcontainers
4242
public class CDCClientIT {
4343

44-
private static final String NEO4J_VERSION = "5";
44+
private static final String NEO4J_VERSION = "2025";
4545

4646
@SuppressWarnings("resource")
4747
@Container
48-
private static final Neo4jContainer<?> neo4j = new Neo4jContainer<>("neo4j:" + NEO4J_VERSION + "-enterprise")
48+
private static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(Neo4j.testImage())
4949
.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", "yes")
5050
.withAdminPassword("passw0rd");
5151

src/test/java/org/neo4j/cdc/client/CDCClientWithAggressiveLogPruningIT.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Map;
2323
import java.util.concurrent.ExecutionException;
2424
import java.util.concurrent.Executors;
25+
import java.util.concurrent.ThreadLocalRandom;
2526
import java.util.concurrent.atomic.AtomicBoolean;
2627
import org.apache.commons.lang3.RandomStringUtils;
2728
import org.junit.jupiter.api.AfterAll;
@@ -40,7 +41,7 @@
4041
@Testcontainers
4142
public class CDCClientWithAggressiveLogPruningIT {
4243
@Container
43-
private static final Neo4jContainer<?> neo4j = new Neo4jContainer<>("neo4j:5-enterprise")
44+
private static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(Neo4j.testImage())
4445
.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", "yes")
4546
.withNeo4jConfig("db.tx_log.rotation.retention_policy", "3 files")
4647
.withNeo4jConfig("db.tx_log.rotation.size", String.format("%d", 128 * 1024))
@@ -77,7 +78,11 @@ void shouldFailWithInvalidChangeIdentifierAfterLogPruning() {
7778
try (var session = driver.session(SessionConfig.forDatabase("neo4j"))) {
7879
session.run(
7980
"CREATE (n:Test) SET n.id = $id, n.data = $data",
80-
Map.of("id", i, "data", RandomStringUtils.random(1024, true, true)));
81+
Map.of(
82+
"id",
83+
i,
84+
"data",
85+
RandomStringUtils.random(1024, 0, 0, true, true, null, ThreadLocalRandom.current())));
8186
}
8287
}
8388

@@ -109,7 +114,12 @@ void shouldNotFailWithInvalidChangeIdentifierAfterLogPruningWhenStreaming()
109114
try (var session = driver.session(SessionConfig.forDatabase("neo4j"))) {
110115
session.run(
111116
"CREATE (n:Test) SET n.id = $id, n.data = $data",
112-
Map.of("id", counter * 100 + j, "data", RandomStringUtils.random(1024, true, true)),
117+
Map.of(
118+
"id",
119+
counter * 100 + j,
120+
"data",
121+
RandomStringUtils.random(
122+
1024, 0, 0, true, true, null, ThreadLocalRandom.current())),
113123
TransactionConfig.builder()
114124
.withMetadata(Map.of("app", "hr"))
115125
.build());
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [https://neo4j.com]
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.neo4j.cdc.client;
18+
19+
public class Neo4j {
20+
21+
public static String testImage() {
22+
String image = System.getenv("NEO4J_TEST_IMAGE");
23+
return image != null ? image : "neo4j:2025-enterprise";
24+
}
25+
}

0 commit comments

Comments
 (0)