|
24 | 24 | import org.apache.kafka.clients.admin.ConfigEntry; |
25 | 25 | import org.apache.kafka.clients.admin.DescribeLogDirsResult; |
26 | 26 | import org.apache.kafka.clients.admin.ListOffsetsResult.ListOffsetsResultInfo; |
27 | | -import org.apache.kafka.clients.admin.NewTopic; |
28 | 27 | import org.apache.kafka.clients.admin.OffsetSpec; |
29 | 28 | import org.apache.kafka.clients.admin.TopicDescription; |
30 | 29 | import org.apache.kafka.clients.consumer.Consumer; |
@@ -546,25 +545,20 @@ public void testExecuteAssignmentWithOneBootstrapServerShutdownWontTimeout() thr |
546 | 545 | } |
547 | 546 |
|
548 | 547 | private void createTopics() { |
549 | | - try (Admin admin = Admin.create(Map.of(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, clusterInstance.bootstrapServers()))) { |
550 | | - Map<Integer, List<Integer>> fooReplicasAssignments = new HashMap<>(); |
551 | | - fooReplicasAssignments.put(0, List.of(0, 1, 2)); |
552 | | - fooReplicasAssignments.put(1, List.of(1, 2, 3)); |
553 | | - Assertions.assertDoesNotThrow(() -> admin.createTopics(List.of(new NewTopic("foo", fooReplicasAssignments))).topicId("foo").get()); |
554 | | - Assertions.assertDoesNotThrow(() -> clusterInstance.waitTopicCreation("foo", fooReplicasAssignments.size())); |
555 | | - |
556 | | - Map<Integer, List<Integer>> barReplicasAssignments = new HashMap<>(); |
557 | | - barReplicasAssignments.put(0, List.of(3, 2, 1)); |
558 | | - Assertions.assertDoesNotThrow(() -> admin.createTopics(List.of(new NewTopic("bar", barReplicasAssignments))).topicId("bar").get()); |
559 | | - Assertions.assertDoesNotThrow(() -> clusterInstance.waitTopicCreation("bar", barReplicasAssignments.size())); |
560 | | - |
561 | | - Map<Integer, List<Integer>> bazReplicasAssignments = new HashMap<>(); |
562 | | - bazReplicasAssignments.put(0, List.of(1, 0, 2)); |
563 | | - bazReplicasAssignments.put(1, List.of(2, 0, 1)); |
564 | | - bazReplicasAssignments.put(2, List.of(0, 2, 1)); |
565 | | - Assertions.assertDoesNotThrow(() -> admin.createTopics(List.of(new NewTopic("baz", bazReplicasAssignments))).topicId("baz").get()); |
566 | | - Assertions.assertDoesNotThrow(() -> clusterInstance.waitTopicCreation("baz", bazReplicasAssignments.size())); |
567 | | - } |
| 548 | + Map<Integer, List<Integer>> fooReplicasAssignments = new HashMap<>(); |
| 549 | + fooReplicasAssignments.put(0, List.of(0, 1, 2)); |
| 550 | + fooReplicasAssignments.put(1, List.of(1, 2, 3)); |
| 551 | + Assertions.assertDoesNotThrow(() -> clusterInstance.createTopicWithAssignment("foo", fooReplicasAssignments)); |
| 552 | + |
| 553 | + Map<Integer, List<Integer>> barReplicasAssignments = new HashMap<>(); |
| 554 | + barReplicasAssignments.put(0, List.of(3, 2, 1)); |
| 555 | + Assertions.assertDoesNotThrow(() -> clusterInstance.createTopicWithAssignment("bar", barReplicasAssignments)); |
| 556 | + |
| 557 | + Map<Integer, List<Integer>> bazReplicasAssignments = new HashMap<>(); |
| 558 | + bazReplicasAssignments.put(0, List.of(1, 0, 2)); |
| 559 | + bazReplicasAssignments.put(1, List.of(2, 0, 1)); |
| 560 | + bazReplicasAssignments.put(2, List.of(0, 2, 1)); |
| 561 | + Assertions.assertDoesNotThrow(() -> clusterInstance.createTopicWithAssignment("baz", bazReplicasAssignments)); |
568 | 562 | } |
569 | 563 |
|
570 | 564 | private void produceMessages(String topic, int partition, int numMessages) { |
|
0 commit comments