cameronlee314 commented on a change in pull request #951: SAMZA-2127: Upgrade 
to Kafka 2.0
URL: https://github.com/apache/samza/pull/951#discussion_r267091668
 
 

 ##########
 File path: 
samza-kafka/src/test/scala/org/apache/samza/system/kafka/TestKafkaSystemAdmin.scala
 ##########
 @@ -257,17 +211,22 @@ class TestKafkaSystemAdmin {
     assertEquals("2", sspMetadata.get(new Partition(48)).getUpcomingOffset)
 
     // Validate that a fetch will return the message.
-    val connector = getConsumerConnector
-    var stream = connector.createMessageStreams(Map(TOPIC -> 
1))(TOPIC).head.iterator
-    var message = stream.next
-    var text = new String(message.message, "UTF-8")
-    connector.shutdown
+    val consumer = getKafkaConsumer
+    consumer.subscribe(JavaConverters.setAsJavaSetConverter(Set(TOPIC)).asJava)
+    val records = consumer.poll(Duration.ofMillis(1000))
+    consumer.close()
+
+    assertTrue(records.count() > 2)
 
 Review comment:
   How come this checks for more than 2 messages? It looks like the test only 
produces 2 messages.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to