|
22 | 22 | import java.util.Map; |
23 | 23 | import java.util.concurrent.ExecutionException; |
24 | 24 | import java.util.concurrent.Executors; |
| 25 | +import java.util.concurrent.ThreadLocalRandom; |
25 | 26 | import java.util.concurrent.atomic.AtomicBoolean; |
26 | 27 | import org.apache.commons.lang3.RandomStringUtils; |
27 | 28 | import org.junit.jupiter.api.AfterAll; |
|
40 | 41 | @Testcontainers |
41 | 42 | public class CDCClientWithAggressiveLogPruningIT { |
42 | 43 | @Container |
43 | | - private static final Neo4jContainer<?> neo4j = new Neo4jContainer<>("neo4j:5-enterprise") |
| 44 | + private static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(Neo4j.testImage()) |
44 | 45 | .withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", "yes") |
45 | 46 | .withNeo4jConfig("db.tx_log.rotation.retention_policy", "3 files") |
46 | 47 | .withNeo4jConfig("db.tx_log.rotation.size", String.format("%d", 128 * 1024)) |
@@ -77,7 +78,11 @@ void shouldFailWithInvalidChangeIdentifierAfterLogPruning() { |
77 | 78 | try (var session = driver.session(SessionConfig.forDatabase("neo4j"))) { |
78 | 79 | session.run( |
79 | 80 | "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()))); |
81 | 86 | } |
82 | 87 | } |
83 | 88 |
|
@@ -109,7 +114,12 @@ void shouldNotFailWithInvalidChangeIdentifierAfterLogPruningWhenStreaming() |
109 | 114 | try (var session = driver.session(SessionConfig.forDatabase("neo4j"))) { |
110 | 115 | session.run( |
111 | 116 | "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())), |
113 | 123 | TransactionConfig.builder() |
114 | 124 | .withMetadata(Map.of("app", "hr")) |
115 | 125 | .build()); |
|
0 commit comments