Skip to content

Commit

Permalink
Merge pull request #69 from jpzk/release/3.6
Browse files Browse the repository at this point in the history
Release/3.6
  • Loading branch information
jpzk authored Apr 6, 2020
2 parents 28598e5 + a81dd2a commit a262924
Show file tree
Hide file tree
Showing 12 changed files with 248 additions and 181 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ target
.idea
.bloop
.metals
project/metals.sbt
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Mocked Streams 3.6

* Changed internal code to interface with new 2.4 TopologyTestDriver methods (https://issues.apache.org/jira/browse/KAFKA-8233,https://cwiki.apache.org/confluence/display/KAFKA/KIP-470%3A+TopologyTestDriver+test+input+and+output+usability+improvements)
* Changed deprecated (from => 2.4.0) calls to Kafka Streams API (https://issues.apache.org/jira/browse/KAFKA-7277)
* Added input timestamps can be specified in Long and in Instant (https://issues.apache.org/jira/browse/KAFKA-7277)
* Removed expected size in new .output and .outputTable methods
* Deprecated output methods with size parameters (not needed anymore)

## Mocked Streams 3.5

* Added support for Apache 2.4.0
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@

Documentation located at http://mockedstreams.madewithtea.com/

Mocked Streams 3.5.2 [(git)](https://github.com/jpzk/mockedstreams) is a library for Scala 2.12 and 2.13 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 3.6.0 [(git)](https://github.com/jpzk/mockedstreams) is a library for Scala 2.12 and 2.13 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" % "3.5.2" % "test"
libraryDependencies += "com.madewithtea" %% "mockedstreams" % "3.6.0" % "test"

Java 8 port of Mocked Streams is [Mockafka](https://github.com/carlosmenezes/mockafka)

## Apache Kafka Compatibility

| Mocked Streams Version | Apache Kafka Version |
|------------- |-------------|
| 3.6.0 | 2.4.1.0 |
| 3.5.2 | 2.4.0.0 |
| 3.5.1 | 2.4.0.0 |
| 3.5.0 | 2.4.0.0 |
Expand Down Expand Up @@ -50,7 +51,7 @@ It wraps the [org.apache.kafka.streams.TopologyTestDriver](https://github.com/ap
MockedStreams()
.topology { builder => builder.stream(...) [...] } // Scala DSL
.input("topic-in", strings, strings, input)
.output("topic-out", strings, strings, exp.size) shouldEqual exp
.output("topic-out", strings, strings) shouldEqual exp

## Multiple Input / Output Example and State

Expand All @@ -64,8 +65,8 @@ It also allows you to have multiple input and output streams. If your topology u
.input("in-b", strings, ints, inputB)
.stores(Seq("store-name"))

mstreams.output("out-a", strings, ints, expA.size) shouldEqual(expectedA)
mstreams.output("out-b", strings, ints, expB.size) shouldEqual(expectedB)
mstreams.output("out-a", strings, ints) shouldEqual(expectedA)
mstreams.output("out-b", strings, ints) shouldEqual(expectedB)

## Record order and multiple emissions

Expand Down Expand Up @@ -152,8 +153,8 @@ Sometimes you need to pass a custom configuration to Kafka Streams:
.input("in-b", strings, ints, inputB)
.stores(Seq("store-name"))

mstreams.output("out-a", strings, ints, expA.size) shouldEqual(expectedA)
mstreams.output("out-b", strings, ints, expB.size) shouldEqual(expectedB)
mstreams.output("out-a", strings, ints) shouldEqual(expectedA)
mstreams.output("out-b", strings, ints) shouldEqual(expectedB)

## Companies using Mocked Streams

Expand Down
15 changes: 12 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
lazy val commonSettings = Seq(
organization := "com.madewithtea",
<<<<<<< HEAD
version := "3.6.0",
scalaVersion := "2.13.1",
crossScalaVersions := List("2.12.10", "2.13.1"),
=======
version := "3.5.2",
scalaVersion := "2.13.1",
crossScalaVersions := List("2.12.11", "2.13.1"),
>>>>>>> master
description := "Topology Unit-Testing Library for Kafka Streams",
organizationHomepage := Some(url("https://www.madewithtea.com")),
scalacOptions := Seq("-Xexperimental")
scalacOptions := Seq("-deprecation","-feature")
)

val scalaTestVersion = "3.0.8"
val rocksDBVersion = "5.18.3"
val kafkaVersion = "2.4.0"
val rocksDBVersion = "5.18.4"
val kafkaVersion = "2.4.1"

lazy val kafka = Seq(
"org.apache.kafka" % "kafka-clients" % kafkaVersion,
Expand All @@ -24,6 +30,8 @@ lazy val kafka = Seq(
lazy val scalaTest = "org.scalatest" %% "scalatest" % scalaTestVersion % "test"
lazy val rocksDB = "org.rocksdb" % "rocksdbjni" % rocksDBVersion % "test"

Global / useGpg := false

lazy val mockedstreams = (project in file("."))
.settings(commonSettings: _*)
.settings(
Expand Down Expand Up @@ -84,6 +92,7 @@ micrositeTwitterCreator := "@madewithtea"
micrositeCompilingDocsTool := WithMdoc
micrositeShareOnSocial := true


lazy val docs = project // new documentation project
.in(file("ms-docs")) // important: it must not be docs/
.dependsOn(mockedstreams)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Please use the corresponding Mocked Streams version to a concrete Apache Kafka v

| Mocked Streams Version | Apache Kafka Version |
|------------- |-------------|
| 3.6.0 | 2.4.1.0 |
| 3.5.2 | 2.4.0.0 |
| 3.5.1 | 2.4.0.0 |
| 3.5.0 | 2.4.0.0 |
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Sometimes you need to pass a custom configuration to Kafka Streams:
.input("in-b", strings, ints, inputB)
.stores(Seq("store-name"))

mstreams.output("out-a", strings, ints, expA.size) shouldEqual(expectedA)
mstreams.output("out-b", strings, ints, expB.size) shouldEqual(expectedB)
mstreams.output("out-a", strings, ints) shouldEqual(expectedA)
mstreams.output("out-b", strings, ints) shouldEqual(expectedB)

2 changes: 1 addition & 1 deletion docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ It wraps the [org.apache.kafka.streams.TopologyTestDriver](https://github.com/ap
MockedStreams()
.topology { builder => builder.stream(...) [...] } // Scala DSL
.input("topic-in", strings, strings, input)
.output("topic-out", strings, strings, exp.size) shouldEqual exp
.output("topic-out", strings, strings) shouldEqual exp


4 changes: 2 additions & 2 deletions docs/docs/multiple.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ It also allows you to have multiple input and output streams. If your topology u
.input("in-b", strings, ints, inputB)
.stores(Seq("store-name"))

mstreams.output("out-a", strings, ints, expA.size) shouldEqual(expectedA)
mstreams.output("out-b", strings, ints, expB.size) shouldEqual(expectedB)
mstreams.output("out-a", strings, ints) shouldEqual(expectedA)
mstreams.output("out-b", strings, ints) shouldEqual(expectedB)
9 changes: 5 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ technologies:
[![Build Status](https://travis-ci.org/jpzk/mockedstreams.svg?branch=master)](https://travis-ci.org/jpzk/mockedstreams) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8abac3d072e54fa3a13dc3da04754c7b)](https://www.codacy.com/app/jpzk/mockedstreams?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=jpzk/mockedstreams&amp;utm_campaign=Badge_Grade)
[![codecov](https://codecov.io/gh/jpzk/mockedstreams/branch/master/graph/badge.svg)](https://codecov.io/gh/jpzk/mockedstreams)

Mocked Streams 3.5.2 is a library for Scala 2.12 and Scala 2.13 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 3.6.0 is a library for Scala 2.12 and Scala 2.13 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" % "3.5.2" % "test"
libraryDependencies += "com.madewithtea" %% "mockedstreams" % "3.6.0" % "test"

## Getting Started

Expand All @@ -28,14 +28,15 @@ It wraps the [org.apache.kafka.streams.TopologyTestDriver](https://github.com/ap
MockedStreams()
.topology { builder => builder.stream(...) [...] } // Scala DSL
.input("topic-in", strings, strings, input)
.output("topic-out", strings, strings, exp.size) shouldEqual exp
.output("topic-out", strings, strings) shouldEqual exp

## Apache Kafka Compatibility

Please use the corresponding Mocked Streams version to a concrete Apache Kafka version.

| Mocked Streams Version | Apache Kafka Version |
|------------- |-------------|
| 3.6.0 | 2.4.1.0 |
| 3.5.2 | 2.4.0.0 |
| 3.5.1 | 2.4.0.0 |
| 3.5.0 | 2.4.0.0 |
Expand All @@ -45,7 +46,7 @@ Please use the corresponding Mocked Streams version to a concrete Apache Kafka v
| 3.1.0 | 2.1.0.0 |
| 2.2.0 | 2.1.0.0 |
| 2.1.0 | 2.0.0.0 |
2.0.0 | 2.0.0.0 |
| 2.0.0 | 2.0.0.0 |
| 1.8.0 | 1.1.1.0 |
| 1.7.0 | 1.1.0.0 |
| 1.6.0 | 1.0.1.0 |
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.0")
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.1.5")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.5")
Loading

0 comments on commit a262924

Please sign in to comment.