|
19 | 19 | import com.datastax.testcontainers.PulsarContainer;
|
20 | 20 | import com.datastax.testcontainers.cassandra.CassandraContainer;
|
21 | 21 | import lombok.extern.slf4j.Slf4j;
|
22 |
| -import org.apache.pulsar.client.api.Consumer; |
23 |
| -import org.apache.pulsar.client.api.Message; |
24 |
| -import org.apache.pulsar.client.api.PulsarClient; |
25 |
| -import org.apache.pulsar.client.api.Schema; |
26 |
| -import org.apache.pulsar.client.api.SubscriptionInitialPosition; |
27 |
| -import org.apache.pulsar.client.api.SubscriptionMode; |
28 |
| -import org.apache.pulsar.client.api.SubscriptionType; |
| 22 | +import org.apache.pulsar.client.api.*; |
29 | 23 | import org.apache.pulsar.client.api.schema.GenericRecord;
|
30 | 24 | import org.apache.pulsar.client.api.schema.RecordSchemaBuilder;
|
31 | 25 | import org.apache.pulsar.client.api.schema.SchemaBuilder;
|
|
39 | 33 | import org.junit.jupiter.api.Test;
|
40 | 34 | import org.testcontainers.containers.Container;
|
41 | 35 | import org.testcontainers.containers.Network;
|
| 36 | +import org.testcontainers.images.builder.Transferable; |
42 | 37 |
|
43 | 38 | import java.io.IOException;
|
44 | 39 | import java.time.Duration;
|
45 |
| -import java.util.ArrayList; |
46 |
| -import java.util.HashMap; |
47 |
| -import java.util.List; |
48 |
| -import java.util.Map; |
49 |
| -import java.util.UUID; |
| 40 | +import java.util.*; |
50 | 41 | import java.util.concurrent.TimeUnit;
|
51 | 42 | import java.util.stream.Collectors;
|
52 | 43 |
|
@@ -229,10 +220,12 @@ public void testUnorderedMutations() throws InterruptedException, IOException {
|
229 | 220 | String pulsarServiceUrl = "pulsar://pulsar:" + pulsarContainer.BROKER_PORT;
|
230 | 221 | Long testId = Math.abs(AgentTestUtil.random.nextLong());
|
231 | 222 | String randomDataDir = System.getProperty("buildDir") + "/data-" + testId + "-";
|
232 |
| - try (CassandraContainer<?> cassandraContainer1 = createCassandraContainer(1, pulsarServiceUrl, testNetwork) |
233 |
| - .withFileSystemBind(randomDataDir + "1", "/var/lib/cassandra"); |
234 |
| - CassandraContainer<?> cassandraContainer2 = createCassandraContainer(2, pulsarServiceUrl, testNetwork) |
235 |
| - .withFileSystemBind(randomDataDir + "2", "/var/lib/cassandra")) { |
| 223 | + try ( |
| 224 | + CassandraContainer<?> cassandraContainer1 = createCassandraContainer(1, pulsarServiceUrl, testNetwork) |
| 225 | + .withCopyToContainer(Transferable.of(randomDataDir + "1"), "/var/lib/cassandra"); |
| 226 | + CassandraContainer<?> cassandraContainer2 = createCassandraContainer(2, pulsarServiceUrl, testNetwork) |
| 227 | + .withCopyToContainer(Transferable.of(randomDataDir + "2"), "/var/lib/cassandra") |
| 228 | + ) { |
236 | 229 | cassandraContainer1.start();
|
237 | 230 | cassandraContainer2.start();
|
238 | 231 |
|
|
0 commit comments