Package dev.responsive.kafka.api
Class ResponsiveTopologyTestDriver
- java.lang.Object
-
- org.apache.kafka.streams.TopologyTestDriver
-
- dev.responsive.kafka.api.ResponsiveTopologyTestDriver
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ResponsiveTopologyTestDriver extends org.apache.kafka.streams.TopologyTestDriver
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRESPONSIVE_TTD_ID
-
Constructor Summary
Constructors Constructor Description ResponsiveTopologyTestDriver(org.apache.kafka.streams.Topology topology)Create a new test diver instance with default test properties.ResponsiveTopologyTestDriver(org.apache.kafka.streams.Topology topology, java.time.Instant initialWallClockTimeMs)Create a new test diver instance with default test properties.ResponsiveTopologyTestDriver(org.apache.kafka.streams.Topology topology, java.util.Properties config)Create a new test diver instance.ResponsiveTopologyTestDriver(org.apache.kafka.streams.Topology topology, java.util.Properties config, java.time.Instant initialWallClockTime)Create a new test diver instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvanceWallClockTime(java.time.Duration advance)Advances the internal mock time used for Responsive-specific features such as ttl, as well as the mock time used for various Kafka Streams functionality such as wall-clock punctuators.-
Methods inherited from class org.apache.kafka.streams.TopologyTestDriver
close, createInputTopic, createInputTopic, createOutputTopic, getAllStateStores, getKeyValueStore, getSessionStore, getStateStore, getTimestampedKeyValueStore, getTimestampedWindowStore, getWindowStore, metrics, producedTopicNames
-
-
-
-
Field Detail
-
RESPONSIVE_TTD_ID
public static final java.lang.String RESPONSIVE_TTD_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResponsiveTopologyTestDriver
public ResponsiveTopologyTestDriver(org.apache.kafka.streams.Topology topology)
Create a new test diver instance with default test properties.Can be used exactly the same as the usual
TopologyTestDriver- Parameters:
topology- the topology to be tested
-
ResponsiveTopologyTestDriver
public ResponsiveTopologyTestDriver(org.apache.kafka.streams.Topology topology, java.util.Properties config)Create a new test diver instance. Initialized the internally mocked wall-clock time withcurrent system time.Can be used exactly the same as the usual
TopologyTestDriver- Parameters:
topology- the topology to be testedconfig- the configuration for the topology
-
ResponsiveTopologyTestDriver
public ResponsiveTopologyTestDriver(org.apache.kafka.streams.Topology topology, java.time.Instant initialWallClockTimeMs)Create a new test diver instance with default test properties.Can be used exactly the same as the usual
TopologyTestDriver- Parameters:
topology- the topology to be testedinitialWallClockTimeMs- the initial value of internally mocked wall-clock time
-
ResponsiveTopologyTestDriver
public ResponsiveTopologyTestDriver(org.apache.kafka.streams.Topology topology, java.util.Properties config, java.time.Instant initialWallClockTime)Create a new test diver instance.Can be used exactly the same as the usual
TopologyTestDriver- Parameters:
topology- the topology to be testedconfig- the configuration for the topologyinitialWallClockTime- the initial value of internally mocked wall-clock time
-
-
Method Detail
-
advanceWallClockTime
public void advanceWallClockTime(java.time.Duration advance)
Advances the internal mock time used for Responsive-specific features such as ttl, as well as the mock time used for various Kafka Streams functionality such as wall-clock punctuators. SeeTopologyTestDriver.advanceWallClockTime(Duration)for more details.- Overrides:
advanceWallClockTimein classorg.apache.kafka.streams.TopologyTestDriver- Parameters:
advance- the amount of time to advance wall-clock time
-
-