Skip to content

Commit 783b477

Browse files
committed
update tests for kafka 8.1.1
1 parent 7d050bc commit 783b477

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

external/kafka/src/test/scala/org/apache/spark/streaming/kafka/KafkaStreamSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import scala.concurrent.duration._
2626
import scala.language.postfixOps
2727
import scala.util.Random
2828

29-
import kafka.admin.CreateTopicCommand
29+
import kafka.admin.AdminUtils
3030
import kafka.common.{KafkaException, TopicAndPartition}
3131
import kafka.producer.{KeyedMessage, Producer, ProducerConfig}
3232
import kafka.serializer.{StringDecoder, StringEncoder}
@@ -130,7 +130,7 @@ abstract class KafkaStreamSuiteBase extends FunSuite with Eventually with Loggin
130130
}
131131

132132
def createTopic(topic: String) {
133-
CreateTopicCommand.createTopic(zkClient, topic, 1, 1, "0")
133+
AdminUtils.createTopic(zkClient, topic, 1, 1)
134134
logInfo("==================== 5 ====================")
135135
// wait until metadata is propagated
136136
waitUntilMetadataIsPropagated(topic, 0)
@@ -166,7 +166,7 @@ abstract class KafkaStreamSuiteBase extends FunSuite with Eventually with Loggin
166166
private def waitUntilMetadataIsPropagated(topic: String, partition: Int) {
167167
eventually(timeout(1000 milliseconds), interval(100 milliseconds)) {
168168
assert(
169-
server.apis.leaderCache.keySet.contains(TopicAndPartition(topic, partition)),
169+
server.apis.metadataCache.containsTopicAndPartition(topic, partition),
170170
s"Partition [$topic, $partition] metadata not propagated after timeout"
171171
)
172172
}

0 commit comments

Comments
 (0)