mirror of https://github.com/apache/kafka.git
Now that Kafka supports Java 17, this PR cleans up the ShareFetchAcknowledgeRequestTest. The changes mostly include: - Collections.singletonList() is replaced with List.of() - Get rid of all asJava conversions Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
dc82c766fa
commit
56aeaa4c44
|
@ -35,6 +35,7 @@ import org.apache.kafka.server.IntegrationTestUtils
|
||||||
import org.junit.jupiter.api.Assertions.{assertEquals, fail}
|
import org.junit.jupiter.api.Assertions.{assertEquals, fail}
|
||||||
|
|
||||||
import java.net.Socket
|
import java.net.Socket
|
||||||
|
import java.util
|
||||||
import java.util.{Comparator, Properties}
|
import java.util.{Comparator, Properties}
|
||||||
import java.util.stream.Collectors
|
import java.util.stream.Collectors
|
||||||
import scala.collection.Seq
|
import scala.collection.Seq
|
||||||
|
@ -132,7 +133,7 @@ class GroupCoordinatorBaseRequestTest(cluster: ClusterInstance) {
|
||||||
replicationFactor = replicationFactor,
|
replicationFactor = replicationFactor,
|
||||||
topicConfig = topicConfig
|
topicConfig = topicConfig
|
||||||
)
|
)
|
||||||
partitionToLeader.map { case (partition, leader) => new TopicIdPartition(getTopicIds(topic), new TopicPartition(topic, partition)) -> leader }
|
partitionToLeader.map { case (partition, leader) => new TopicIdPartition(getTopicIds.get(topic), new TopicPartition(topic, partition)) -> leader }
|
||||||
} finally {
|
} finally {
|
||||||
admin.close()
|
admin.close()
|
||||||
}
|
}
|
||||||
|
@ -142,8 +143,8 @@ class GroupCoordinatorBaseRequestTest(cluster: ClusterInstance) {
|
||||||
cluster.brokers.values.stream.allMatch(b => b.config.unstableApiVersionsEnabled)
|
cluster.brokers.values.stream.allMatch(b => b.config.unstableApiVersionsEnabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected def getTopicIds: Map[String, Uuid] = {
|
protected def getTopicIds: util.Map[String, Uuid] = {
|
||||||
cluster.controllers().get(cluster.controllerIds().iterator().next()).controller.findAllTopicIds(ANONYMOUS_CONTEXT).get().asScala.toMap
|
cluster.controllers().get(cluster.controllerIds().iterator().next()).controller.findAllTopicIds(ANONYMOUS_CONTEXT).get()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected def getBrokers: Seq[KafkaBroker] = {
|
protected def getBrokers: Seq[KafkaBroker] = {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue