Browse Source

MINOR: fix scala serde tests (#5644)

Reviewers: Guozhang Wang <wangguoz@gmail.com>
pull/5648/head
John Roesler 6 years ago committed by Guozhang Wang
parent
commit
b18c8dda52
  1. 16
      streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/ConsumedTest.scala
  2. 6
      streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala
  3. 20
      streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/MaterializedTest.scala
  4. 8
      streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/ProducedTest.scala
  5. 4
      streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/SerializedTest.scala

16
streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/ConsumedTest.scala

@ -34,8 +34,8 @@ class ConsumedTest extends FlatSpec with Matchers { @@ -34,8 +34,8 @@ class ConsumedTest extends FlatSpec with Matchers {
val consumed: Consumed[String, Long] = Consumed.`with`[String, Long]
val internalConsumed = new ConsumedInternal(consumed)
internalConsumed.keySerde shouldBe Serdes.String
internalConsumed.valueSerde shouldBe Serdes.Long
internalConsumed.keySerde.getClass shouldBe Serdes.String.getClass
internalConsumed.valueSerde.getClass shouldBe Serdes.Long.getClass
}
"Create a Consumed with timestampExtractor and resetPolicy" should "create a Consumed with Serdes, timestampExtractor and resetPolicy" in {
@ -45,8 +45,8 @@ class ConsumedTest extends FlatSpec with Matchers { @@ -45,8 +45,8 @@ class ConsumedTest extends FlatSpec with Matchers {
Consumed.`with`[String, Long](timestampExtractor, resetPolicy)
val internalConsumed = new ConsumedInternal(consumed)
internalConsumed.keySerde shouldBe Serdes.String
internalConsumed.valueSerde shouldBe Serdes.Long
internalConsumed.keySerde.getClass shouldBe Serdes.String.getClass
internalConsumed.valueSerde.getClass shouldBe Serdes.Long.getClass
internalConsumed.timestampExtractor shouldBe timestampExtractor
internalConsumed.offsetResetPolicy shouldBe resetPolicy
}
@ -56,8 +56,8 @@ class ConsumedTest extends FlatSpec with Matchers { @@ -56,8 +56,8 @@ class ConsumedTest extends FlatSpec with Matchers {
val consumed: Consumed[String, Long] = Consumed.`with`[String, Long](timestampExtractor)
val internalConsumed = new ConsumedInternal(consumed)
internalConsumed.keySerde shouldBe Serdes.String
internalConsumed.valueSerde shouldBe Serdes.Long
internalConsumed.keySerde.getClass shouldBe Serdes.String.getClass
internalConsumed.valueSerde.getClass shouldBe Serdes.Long.getClass
internalConsumed.timestampExtractor shouldBe timestampExtractor
}
@ -66,8 +66,8 @@ class ConsumedTest extends FlatSpec with Matchers { @@ -66,8 +66,8 @@ class ConsumedTest extends FlatSpec with Matchers {
val consumed: Consumed[String, Long] = Consumed.`with`[String, Long](resetPolicy)
val internalConsumed = new ConsumedInternal(consumed)
internalConsumed.keySerde shouldBe Serdes.String
internalConsumed.valueSerde shouldBe Serdes.Long
internalConsumed.keySerde.getClass shouldBe Serdes.String.getClass
internalConsumed.valueSerde.getClass shouldBe Serdes.Long.getClass
internalConsumed.offsetResetPolicy shouldBe resetPolicy
}
}

6
streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala

@ -30,8 +30,8 @@ class JoinedTest extends FlatSpec with Matchers { @@ -30,8 +30,8 @@ class JoinedTest extends FlatSpec with Matchers {
"Create a Joined" should "create a Joined with Serdes" in {
val joined: Joined[String, Long, Int] = Joined.`with`[String, Long, Int]
joined.keySerde shouldBe Serdes.String
joined.valueSerde shouldBe Serdes.Long
joined.otherValueSerde shouldBe Serdes.Integer
joined.keySerde.getClass shouldBe Serdes.String.getClass
joined.valueSerde.getClass shouldBe Serdes.Long.getClass
joined.otherValueSerde.getClass shouldBe Serdes.Integer.getClass
}
}

20
streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/MaterializedTest.scala

@ -34,8 +34,8 @@ class MaterializedTest extends FlatSpec with Matchers { @@ -34,8 +34,8 @@ class MaterializedTest extends FlatSpec with Matchers {
Materialized.`with`[String, Long, ByteArrayKeyValueStore]
val internalMaterialized = new MaterializedInternal(materialized)
internalMaterialized.keySerde shouldBe Serdes.String
internalMaterialized.valueSerde shouldBe Serdes.Long
internalMaterialized.keySerde.getClass shouldBe Serdes.String.getClass
internalMaterialized.valueSerde.getClass shouldBe Serdes.Long.getClass
}
"Create a Materialize with a store name" should "create a Materialized with Serdes and a store name" in {
@ -44,8 +44,8 @@ class MaterializedTest extends FlatSpec with Matchers { @@ -44,8 +44,8 @@ class MaterializedTest extends FlatSpec with Matchers {
Materialized.as[String, Long, ByteArrayKeyValueStore](storeName)
val internalMaterialized = new MaterializedInternal(materialized)
internalMaterialized.keySerde shouldBe Serdes.String
internalMaterialized.valueSerde shouldBe Serdes.Long
internalMaterialized.keySerde.getClass shouldBe Serdes.String.getClass
internalMaterialized.valueSerde.getClass shouldBe Serdes.Long.getClass
internalMaterialized.storeName shouldBe storeName
}
@ -55,8 +55,8 @@ class MaterializedTest extends FlatSpec with Matchers { @@ -55,8 +55,8 @@ class MaterializedTest extends FlatSpec with Matchers {
Materialized.as[String, Long](storeSupplier)
val internalMaterialized = new MaterializedInternal(materialized)
internalMaterialized.keySerde shouldBe Serdes.String
internalMaterialized.valueSerde shouldBe Serdes.Long
internalMaterialized.keySerde.getClass shouldBe Serdes.String.getClass
internalMaterialized.valueSerde.getClass shouldBe Serdes.Long.getClass
internalMaterialized.storeSupplier shouldBe storeSupplier
}
@ -66,8 +66,8 @@ class MaterializedTest extends FlatSpec with Matchers { @@ -66,8 +66,8 @@ class MaterializedTest extends FlatSpec with Matchers {
Materialized.as[String, Long](storeSupplier)
val internalMaterialized = new MaterializedInternal(materialized)
internalMaterialized.keySerde shouldBe Serdes.String
internalMaterialized.valueSerde shouldBe Serdes.Long
internalMaterialized.keySerde.getClass shouldBe Serdes.String.getClass
internalMaterialized.valueSerde.getClass shouldBe Serdes.Long.getClass
internalMaterialized.storeSupplier shouldBe storeSupplier
}
@ -77,8 +77,8 @@ class MaterializedTest extends FlatSpec with Matchers { @@ -77,8 +77,8 @@ class MaterializedTest extends FlatSpec with Matchers {
Materialized.as[String, Long](storeSupplier)
val internalMaterialized = new MaterializedInternal(materialized)
internalMaterialized.keySerde shouldBe Serdes.String
internalMaterialized.valueSerde shouldBe Serdes.Long
internalMaterialized.keySerde.getClass shouldBe Serdes.String.getClass
internalMaterialized.valueSerde.getClass shouldBe Serdes.Long.getClass
internalMaterialized.storeSupplier shouldBe storeSupplier
}
}

8
streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/ProducedTest.scala

@ -33,8 +33,8 @@ class ProducedTest extends FlatSpec with Matchers { @@ -33,8 +33,8 @@ class ProducedTest extends FlatSpec with Matchers {
val produced: Produced[String, Long] = Produced.`with`[String, Long]
val internalProduced = new ProducedInternal(produced)
internalProduced.keySerde shouldBe Serdes.String
internalProduced.valueSerde shouldBe Serdes.Long
internalProduced.keySerde.getClass shouldBe Serdes.String.getClass
internalProduced.valueSerde.getClass shouldBe Serdes.Long.getClass
}
"Create a Produced with timestampExtractor and resetPolicy" should "create a Consumed with Serdes, timestampExtractor and resetPolicy" in {
@ -44,8 +44,8 @@ class ProducedTest extends FlatSpec with Matchers { @@ -44,8 +44,8 @@ class ProducedTest extends FlatSpec with Matchers {
val produced: Produced[String, Long] = Produced.`with`(partitioner)
val internalConsumed = new ProducedInternal(produced)
internalConsumed.keySerde shouldBe Serdes.String
internalConsumed.valueSerde shouldBe Serdes.Long
internalConsumed.keySerde.getClass shouldBe Serdes.String.getClass
internalConsumed.valueSerde.getClass shouldBe Serdes.Long.getClass
internalConsumed.streamPartitioner shouldBe partitioner
}
}

4
streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/SerializedTest.scala

@ -32,7 +32,7 @@ class SerializedTest extends FlatSpec with Matchers { @@ -32,7 +32,7 @@ class SerializedTest extends FlatSpec with Matchers {
val serialized: Serialized[String, Long] = Serialized.`with`[String, Long]
val internalSerialized = new SerializedInternal(serialized)
internalSerialized.keySerde shouldBe Serdes.String
internalSerialized.valueSerde shouldBe Serdes.Long
internalSerialized.keySerde.getClass shouldBe Serdes.String.getClass
internalSerialized.valueSerde.getClass shouldBe Serdes.Long.getClass
}
}

Loading…
Cancel
Save