srowen commented on a change in pull request #22282: [SPARK-23539][SS] Add 
support for Kafka headers in Structured Streaming
URL: https://github.com/apache/spark/pull/22282#discussion_r247349348
 
 

 ##########
 File path: 
external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaTestUtils.scala
 ##########
 @@ -485,3 +504,22 @@ class KafkaTestUtils(withBrokerProps: Map[String, Object] 
= Map.empty) extends L
   }
 }
 
+object KafkaTestUtils {
+
+  def assertEqual(lhs: (String, Array[(String, Array[Byte])]),
+                  rhs: (String, Array[(String, Array[Byte])])): Unit = {
+    assert(lhs._1 == rhs._1)
+    assert(lhs._2.size == rhs._2.size)
+    (0 until lhs._2.size) foreach { i =>
+      assert(lhs._2(i)._1 == rhs._2(i)._1)
+      assert(lhs._2(i)._2.deep == rhs._2(i)._2.deep)
+    }
+  }
+
+  def assertEqual(lhs: Array[(String, Array[(String, Array[Byte])])],
 
 Review comment:
   I think scalatest will understand tuple comparison already. It should be 
able to compare arrays too. Check its methods to see how to do deep 
comparisons. You may not need more utility methods

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to