Source:
<code>public void runApplication(StreamApplication streamApplication, String appName, Map<String, String> overriddenConfigs) { Map<String, String> configs = new HashMap<>(); configs.put("job.factory.class", "org.apache.samza.job.local.ThreadJobFactory"); configs.put("job.name", appName); configs.put("app.class", streamApplication.getClass().getCanonicalName()); configs.put("serializers.registry.json.class", "org.apache.samza.serializers.JsonSerdeFactory"); configs.put("serializers.registry.string.class", "org.apache.samza.serializers.StringSerdeFactory"); configs.put("systems.kafka.samza.factory", "org.apache.samza.system.kafka.KafkaSystemFactory"); configs.put("systems.kafka.consumer.zookeeper.connect", zkConnect()); configs.put("systems.kafka.producer.bootstrap.servers", bootstrapUrl()); configs.put("systems.kafka.samza.key.serde", "string"); configs.put("systems.kafka.samza.msg.serde", "string"); configs.put("systems.kafka.samza.offset.default", "oldest"); configs.put("job.coordinator.system", "kafka"); configs.put("job.default.system", "kafka"); configs.put("job.coordinator.replication.factor", "1"); configs.put("task.window.ms", "1000"); configs.put("task.checkpoint.factory", TestStreamManager.MockCheckpointManagerFactory.class.getName()); configs.put("task.shutdown.ms", "1"); if (overriddenConfigs != null) { configs.putAll(overriddenConfigs); } app = streamApplication; <START> runner = (RemoteApplicationRunner) ApplicationRunner.fromConfig(new MapConfig(configs)); <END> runner.run(streamApplication); StreamAssert.waitForComplete(); }</code><technical_language>common case is run LocalApplicationRunner in integration test in samza-test. keeping runner type generic (i.e. ApplicationRunner) allows test runner implementations in test. I want limit instance a specific implementation class</technical_language>

Target:
public void runApplication(StreamApplication streamApplication, String appName, Map<String, String> overriddenConfigs) { Map<String, String> configs = new HashMap<>(); configs.put("job.factory.class", "org.apache.samza.job.local.ThreadJobFactory"); configs.put("job.name", appName); configs.put("app.class", streamApplication.getClass().getCanonicalName()); configs.put("serializers.registry.json.class", "org.apache.samza.serializers.JsonSerdeFactory"); configs.put("serializers.registry.string.class", "org.apache.samza.serializers.StringSerdeFactory"); configs.put("systems.kafka.samza.factory", "org.apache.samza.system.kafka.KafkaSystemFactory"); configs.put("systems.kafka.consumer.zookeeper.connect", zkConnect()); configs.put("systems.kafka.producer.bootstrap.servers", bootstrapUrl()); configs.put("systems.kafka.samza.key.serde", "string"); configs.put("systems.kafka.samza.msg.serde", "string"); configs.put("systems.kafka.samza.offset.default", "oldest"); configs.put("job.coordinator.system", "kafka"); configs.put("job.default.system", "kafka"); configs.put("job.coordinator.replication.factor", "1"); configs.put("task.window.ms", "1000"); configs.put("task.checkpoint.factory", TestStreamManager.MockCheckpointManagerFactory.class.getName()); configs.put("task.shutdown.ms", "1"); if (overriddenConfigs != null) { configs.putAll(overriddenConfigs); } app = streamApplication; runner = (AbstractApplicationRunner) ApplicationRunner.fromConfig(new MapConfig(configs)); runner.run(streamApplication); StreamAssert.waitForComplete(); }