From 50ba89df1fb044e6ede5c3483c9e9628097b9aa2 Mon Sep 17 00:00:00 2001 From: Jendrik Poloczek Date: Thu, 15 Mar 2018 11:13:59 +0100 Subject: [PATCH 1/3] version bump, small beautification --- README.md | 11 ++++++----- build.sbt | 6 +++--- src/main/scala/MockedStreams.scala | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9d6cf6a..801783e 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,16 @@ [![codecov](https://codecov.io/gh/jpzk/mockedstreams/branch/master/graph/badge.svg)](https://codecov.io/gh/jpzk/mockedstreams) [![License](http://img.shields.io/:license-Apache%202-grey.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt) [![GitHub stars](https://img.shields.io/github/stars/jpzk/mockedstreams.svg?style=flat)](https://github.com/jpzk/mockedstreams/stargazers) -Mocked Streams 1.5.0 [(git)](https://github.com/jpzk/mockedstreams) is a library for Scala 2.11 and 2.12 which allows you to **unit-test processing topologies** of [Kafka Streams](https://kafka.apache.org/documentation#streams) applications (since Apache Kafka >=0.10.1) **without Zookeeper and Kafka Brokers**. Further, you can use your favourite Scala testing framework e.g. [ScalaTest](http://www.scalatest.org/) and [Specs2](https://etorreborre.github.io/specs2/). Mocked Streams is located at the Maven Central Repository, therefore you just have to add the following to your [SBT dependencies](http://www.scala-sbt.org/0.13/docs/Library-Dependencies.html): +Mocked Streams 1.6.0 [(git)](https://github.com/jpzk/mockedstreams) is a library for Scala 2.11 and 2.12 which allows you to **unit-test processing topologies** of [Kafka Streams](https://kafka.apache.org/documentation#streams) applications (since Apache Kafka >=0.10.1) **without Zookeeper and Kafka Brokers**. Further, you can use your favourite Scala testing framework e.g. [ScalaTest](http://www.scalatest.org/) and [Specs2](https://etorreborre.github.io/specs2/). Mocked Streams is located at the Maven Central Repository, therefore you just have to add the following to your [SBT dependencies](http://www.scala-sbt.org/0.13/docs/Library-Dependencies.html): - libraryDependencies += "com.madewithtea" %% "mockedstreams" % "1.5.0" % "test" + libraryDependencies += "com.madewithtea" %% "mockedstreams" % "1.6.0" % "test" ## Apache Kafka Compatibility -| Mocked Streams Version | Apache Kafka Version | -| ------------- |-------------| -| 1.5.0 | 1.0.0.0 | +| Mocked Streams Version | Apache Kafka Version | +|------------- |-------------| +| 1.6.0 | 1.0.1.0 | +| 1.5.0 | 1.0.0.0 | | 1.4.0 | 0.11.0.1 | | 1.3.0 | 0.11.0.0 | | 1.2.1 | 0.10.2.1 | diff --git a/build.sbt b/build.sbt index fd99e17..3cb46cb 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,8 @@ lazy val commonSettings = Seq( organization := "com.madewithtea", - version := "1.5.0", - scalaVersion := "2.12.2", + version := "1.6.0", + scalaVersion := "2.12.4", crossScalaVersions := Seq("2.12.2","2.11.11"), description := "Topology Unit-Testing Library for Apache Kafka / Kafka Streams", organizationHomepage := Some(url("https://www.madewithtea.com")), @@ -10,7 +10,7 @@ lazy val commonSettings = Seq( val scalaTestVersion = "3.0.4" val rocksDBVersion = "5.7.3" -val kafkaVersion = "1.0.0" +val kafkaVersion = "1.0.1" lazy val kafka = Seq( "org.apache.kafka" % "kafka-clients" % kafkaVersion, diff --git a/src/main/scala/MockedStreams.scala b/src/main/scala/MockedStreams.scala index 446ca04..52eab63 100644 --- a/src/main/scala/MockedStreams.scala +++ b/src/main/scala/MockedStreams.scala @@ -49,7 +49,7 @@ object MockedStreams { val updatedRecords = newRecords.foldLeft(inputs) { case (events, (k, v)) => val newRecord = Record(topic, keySer.serialize(topic, k), valSer.serialize(topic, v)) - events :+ newRecord + events :+ newRecord } this.copy(inputs = updatedRecords) @@ -58,7 +58,7 @@ object MockedStreams { def output[K, V](topic: String, key: Serde[K], value: Serde[V], size: Int) = { if (size <= 0) throw new ExpectedOutputIsEmpty withProcessedDriver { driver => - (0 until size).flatMap { i => + (0 until size).flatMap { _ => Option(driver.readOutput(topic, key.deserializer, value.deserializer)) match { case Some(record) => Some((record.key, record.value)) case None => None @@ -104,7 +104,7 @@ object MockedStreams { } private def produce(driver: Driver): Unit = { - inputs.foreach{ + inputs.foreach { case Record(topic, key, value) => driver.process(topic, key, value) } From b96fd23128b7120a3f406edf1aa99233fd47b5b1 Mon Sep 17 00:00:00 2001 From: Jendrik Poloczek Date: Thu, 15 Mar 2018 11:16:33 +0100 Subject: [PATCH 2/3] changed cross compile versions --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 3cb46cb..0b50f1a 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ lazy val commonSettings = Seq( organization := "com.madewithtea", version := "1.6.0", scalaVersion := "2.12.4", - crossScalaVersions := Seq("2.12.2","2.11.11"), + crossScalaVersions := Seq("2.12.4","2.11.11"), description := "Topology Unit-Testing Library for Apache Kafka / Kafka Streams", organizationHomepage := Some(url("https://www.madewithtea.com")), scalacOptions := Seq("-Xexperimental")) From efcbc1eece1cee7f987a681be8b3c063a1f19af6 Mon Sep 17 00:00:00 2001 From: Jendrik Poloczek Date: Thu, 15 Mar 2018 11:24:15 +0100 Subject: [PATCH 3/3] changed CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd743c3..0147e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Mocked Streams 1.6.0 + +* Build against Apache Kafka 1.0.1 +* Updated Scala 2.12 version to 2.12.4 + ## Mocked Streams 1.5.0 * Build against Apache Kafka 1.0