@Test
    public void testOneWord() {
        //Feed word "Hello" to inputTopic and no kafka key, timestamp is irrelevant in this case
        inputTopic.pipeInput("Hello");
        //Read and validate output to match word as key and count as value
        assertThat(outputTopic.readKeyValue(), equalTo(new KeyValue<>("hello", 1L)));
        //No more output in topic
        assertThat(outputTopic.isEmpty(), is(true));
    }
Simple test validating count of one word
streams/examples/src/test/java/org/apache/kafka/streams/examples/wordcount/WordCountDemoTest.java