kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch trunk updated: MINOR: Fix compilation error in PlaintextConsumerTest under scala 2.12 (#5674)
Date Fri, 21 Sep 2018 23:00:14 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 95f9622  MINOR: Fix compilation error in PlaintextConsumerTest under scala 2.12 (#5674)
95f9622 is described below

commit 95f9622cce2d4a47d59bdfe2dbce6c1cbc2e4573
Author: John Roesler <vvcephei@users.noreply.github.com>
AuthorDate: Fri Sep 21 18:00:05 2018 -0500

    MINOR: Fix compilation error in PlaintextConsumerTest under scala 2.12 (#5674)
---
 .../kafka/api/PlaintextConsumerTest.scala          | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala
index fc5a24f..4417028 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala
@@ -66,38 +66,38 @@ class PlaintextConsumerTest extends BaseConsumerTest {
     }
   }
 
-  trait SerializerImpl {
+  trait SerializerImpl extends Serializer[Array[Byte]]{
     var serializer = new ByteArraySerializer()
 
-    def serialize(topic: String, headers: Headers, data: Array[Byte]): Array[Byte] = {
+    override def serialize(topic: String, headers: Headers, data: Array[Byte]): Array[Byte]
= {
       headers.add("content-type", "application/octet-stream".getBytes)
       serializer.serialize(topic, data)
     }
 
-    def configure(configs: util.Map[String, _], isKey: Boolean): Unit = serializer.configure(configs,
isKey)
+    override def configure(configs: util.Map[String, _], isKey: Boolean): Unit = serializer.configure(configs,
isKey)
 
-    def close(): Unit = serializer.close()
+    override def close(): Unit = serializer.close()
 
-    def serialize(topic: String, data: Array[Byte]): Array[Byte] = {
+    override def serialize(topic: String, data: Array[Byte]): Array[Byte] = {
       fail("method should not be invoked")
       null
     }
   }
 
-  trait DeserializerImpl {
+  trait DeserializerImpl extends Deserializer[Array[Byte]]{
     var deserializer = new ByteArrayDeserializer()
 
-    def deserialize(topic: String, headers: Headers, data: Array[Byte]): Array[Byte] = {
+    override def deserialize(topic: String, headers: Headers, data: Array[Byte]): Array[Byte]
= {
       val header = headers.lastHeader("content-type")
       assertEquals("application/octet-stream", if (header == null) null else new String(header.value()))
       deserializer.deserialize(topic, data)
     }
 
-    def configure(configs: util.Map[String, _], isKey: Boolean): Unit = deserializer.configure(configs,
isKey)
+    override def configure(configs: util.Map[String, _], isKey: Boolean): Unit = deserializer.configure(configs,
isKey)
 
-    def close(): Unit = deserializer.close()
+    override def close(): Unit = deserializer.close()
 
-    def deserialize(topic: String, data: Array[Byte]): Array[Byte] = {
+    override def deserialize(topic: String, data: Array[Byte]): Array[Byte] = {
       fail("method should not be invoked")
       null
     }
@@ -128,6 +128,7 @@ class PlaintextConsumerTest extends BaseConsumerTest {
   @Test
   def testHeadersExtendedSerializerDeserializer(): Unit = {
     val extendedSerializer = new ExtendedSerializer[Array[Byte]] with SerializerImpl
+
     val extendedDeserializer = new ExtendedDeserializer[Array[Byte]] with DeserializerImpl
 
     testHeadersSerializeDeserialize(extendedSerializer, extendedDeserializer)
@@ -136,6 +137,7 @@ class PlaintextConsumerTest extends BaseConsumerTest {
   @Test
   def testHeadersSerializerDeserializer(): Unit = {
     val extendedSerializer = new Serializer[Array[Byte]] with SerializerImpl
+
     val extendedDeserializer = new Deserializer[Array[Byte]] with DeserializerImpl
 
     testHeadersSerializeDeserialize(extendedSerializer, extendedDeserializer)


Mime
View raw message