Skip to content

Commit

Permalink
MINOR: add docs for KIP-680 (#10048)
Browse files Browse the repository at this point in the history
Reviewers: Bill Bejeck <bill@confluent.io>, Jim Galasyn <jim.galasyn@confluent.io>
  • Loading branch information
mjsax authored Feb 5, 2021
1 parent 470e6f2 commit d01d97e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 2 additions & 9 deletions docs/streams/developer-guide/testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,8 @@ <h2><a class="toc-backref" href="#testing-topologytestdriver" title="Permalink t
builder.stream("input-topic").filter(...).to("output-topic");
Topology topology = builder.build();

// setup test driver
Properties props = new Properties();
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "test");
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "dummy:1234");
TopologyTestDriver testDriver = new TopologyTestDriver(topology, props);</code></pre>
// create test driver
TopologyTestDriver testDriver = new TopologyTestDriver(topology);</code></pre>
<p>
With the test driver you can create <code>TestInputTopic</code> giving topic name and the corresponding serializers.
<code>TestInputTopic</code> provides various methods to pipe new message values, keys and values, or list of KeyValue objects.
Expand Down Expand Up @@ -151,8 +148,6 @@ <h3>Example</h3>

// setup test driver
Properties props = new Properties();
props.setProperty(StreamsConfig.APPLICATION_ID_CONFIG, "maxAggregation");
props.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "dummy:1234");
props.setProperty(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
props.setProperty(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.Long().getClass().getName());
testDriver = new TopologyTestDriver(topology, props);
Expand Down Expand Up @@ -286,8 +281,6 @@ <h2>
If you need to pass configuration to your processor or set the default serdes, you can create the mock with
config:
<pre class="line-numbers"><code class="language-text">final Properties props = new Properties();
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "unit-test");
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "");
props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass());
props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.Long().getClass());
props.put("some.other.config", "some config value");
Expand Down
6 changes: 6 additions & 0 deletions docs/streams/upgrade-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ <h3><a id="streams_api_changes_280" href="#streams_api_changes_280">Streams API
the constructor, such as when using the console consumer. <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-659%3A+Improve+TimeWindowedDeserializer+and+TimeWindowedSerde+to+handle+window+size">KIP-659</a>
has more details.
</p>
<p>
To simplify testing, two new constructors that don't require a <code>Properties</code> parameter have been
added to the <code>TopologyTestDriver</code> class. If <code>Properties</code> are passed
into the constructor, it is no longer required to set mandatory configuration parameters
(cf. <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-680%3A+TopologyTestDriver+should+not+require+a+Properties+argument">KIP-680</a>).
</p>

<h3><a id="streams_api_changes_270" href="#streams_api_changes_270">Streams API changes in 2.7.0</a></h3>
<p>
Expand Down

0 comments on commit d01d97e

Please sign in to comment.