Packages

package test

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbstractKafkaStreamsFeatureTest extends Test with EmbeddedKafka

    Extensible abstract test class that provides helper methods to create and access the kafka topics used in testing.

  2. case class FinatraTopologyTester extends Logging with Product with Serializable
  3. trait IteratorWithAutoCloseToSeq extends AnyRef
  4. abstract class KafkaStreamsFeatureTest extends AbstractKafkaStreamsFeatureTest with KafkaFeatureTest

    Extensible abstract test class used when testing a single KafkaStreamsTwitterServer in your test.

  5. abstract class KafkaStreamsMultiServerFeatureTest extends AbstractKafkaStreamsFeatureTest

    Extensible abstract test class used when testing multiple KafkaStreamsTwitterServers in your test.

  6. trait TimeTraveler extends AnyRef

    Helper class to modify the timestamps that will be used in FinatraStreams tests.

  7. abstract class TopologyFeatureTest extends Test

    Extensible abstract test class used when testing your KafkaStreams topology using the FinatraTopologyTester.

    Extensible abstract test class used when testing your KafkaStreams topology using the FinatraTopologyTester.

    Example usage:

      class WordCountServerTopologyFeatureTest extends TopologyFeatureTest {
    
      override val topologyTester = FinatraTopologyTester(
        kafkaApplicationId = "wordcount-prod-bob",
        server = new WordCountRocksDbServer,
        startingWallClockTime = new DateTime("2018-01-01T00:00:00Z")
      )
    
      private val textLinesTopic =
        topologyTester.topic("TextLinesTopic", Serdes.ByteArray(), Serdes.String)
    
      private val wordsWithCountsTopic =
        topologyTester.topic("WordsWithCountsTopic", Serdes.String, ScalaSerdes.Long)
    
      test("word count test 1") {
        val countsStore = topologyTester.getKeyValueStore[String, Long]("CountsStore")
    
        textLinesTopic.pipeInput(Array.emptyByteArray, "Hello World Hello")
    
        wordsWithCountsTopic.assertOutput("Hello", 1)
        wordsWithCountsTopic.assertOutput("World", 1)
        wordsWithCountsTopic.assertOutput("Hello", 2)
    
        countsStore.get("Hello") should equal(2)
        countsStore.get("World") should equal(1)
      }
    
      test("word count test 2") {
        val countsStore = topologyTester.getKeyValueStore[String, Long]("CountsStore")
    
        textLinesTopic.pipeInput(Array.emptyByteArray, "yo yo yo")
    
        wordsWithCountsTopic.assertOutput("yo", 1)
        wordsWithCountsTopic.assertOutput("yo", 2)
        wordsWithCountsTopic.assertOutput("yo", 3)
    
        countsStore.get("yo") should equal(3)
      }
    }
  8. class TopologyTesterTopic[K, V] extends Matchers

    Used to read/write from Kafka topics in the topology tester.

    Used to read/write from Kafka topics in the topology tester.

    K

    the type of the key

    V

    the type of the value

Value Members

  1. object FinatraTopologyTester extends Serializable
  2. object TestDirectoryUtils extends Logging

Ungrouped