Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.
/ unittest-kafka Public archive

The easiest way to unit test for Scala code using Kafka

Notifications You must be signed in to change notification settings

esmusssein/unittest-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unittest-kafka

The easiest way to do unit testing for Scala with Kafka

No need to run Kafka on your computer. Just follow the below.

class FooSpec extends FlatSpec with TestKit {
  import TestKit._

  it should "produce a message to topic FOO" in {
    subscribe("FOO") {
      Foo.produceKafkaMessage("hello world")
      poll("FOO") should be ("hello world")
    }
  }
  
  it should "receive a message from topic BAR" in {
    send("BAR", "hello world")
    ...
  }
}

Further works

  1. Publish its jar to a central repository.
  2. Your opinion..

About

The easiest way to unit test for Scala code using Kafka

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published