Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For many use cases of TopologyTestDriver, we don't need to specify properties parameter. As of https://github.com/apache/kafka/pull/9477, many TopologyTestDriver usages will have no configurations at all to specify, so we should provide a constructor that doesn't take a Properties argument. Right now, such configuration-free usages have to provide an empty Properties object.

Application-id set by default should be randomized so that no two tests can interfere with each other. 

Public Interfaces

Code Block
languagejava
themeEclipse
titlePublic Constructor
linenumberstrue
	/**
     * Create a new test diver instance.
     * Default test properties are used to initialize the driver instance
     *
     * @param topology the topology to be tested
     */
    public TopologyTestDriver(final Topology topology) {
        this(topology, DEFAULT_TEST_PROPS);
    }

	private static final Properties DEFAULT_TEST_PROPS;

    static {
        DEFAULT_TEST_PROPS = new Properties();
        DEFAULT_TEST_PROPS.put(APPLICATION_ID_CONFIG, "dummy-app-id");
        DEFAULT_TEST_PROPS.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "dummy");
    }

...