Source:
<code>public Map<String, TestRunSink> testRunTopology(Topology topology, String configJson) throws Exception { TopologyDag dag = topologyDagBuilder.getDag(topology); topology.setTopologyDag(dag); ensureValid(dag); TopologyActions topologyActions = getTopologyActionsInstance(topology); LOG.debug("Running topology in test mode", topology); setUpClusterArtifacts(topology, topologyActions); String mavenArtifacts = setUpExtraJars(topology, topologyActions); ObjectMapper objectMapper = new ObjectMapper(); <START> Map<String, List<Map<String, Object>>> testRecordsMap = objectMapper.readValue(configJson, <END> new TypeReference<Map<String, List<Map<String, Object>>>>() {}); List<StreamlineSource> sources = dag.getOutputComponents().stream() .filter(c -> c instanceof StreamlineSource) .map(c -> (StreamlineSource) c) .collect(toList()); List<StreamlineSink> sinks = dag.getInputComponents().stream() .filter(c -> c instanceof StreamlineSink) .map(c -> (StreamlineSink) c) .collect(toList()); Map<String, TestRunSource> testRunSourceMap = sources.stream() .collect(toMap(s -> s.getName(), s -> new TestRunSource(s.getOutputStreams(), testRecordsMap.get(s.getName())))); Map<String, TestRunSink> testRunSinkMap = sinks.stream() .collect(toMap(s -> s.getName(), s -> { String uuid = UUID.randomUUID().toString(); return new TestRunSink(uuid, getTopologyTestRunResult(uuid)); })); TopologyLayout topologyLayout = CatalogToLayoutConverter.getTopologyLayout(topology, dag); topologyActions.testRun(topologyLayout, mavenArtifacts, testRunSourceMap, testRunSinkMap); return testRunSinkMap; }</code><technical_language>minor: want rename emphasizing records for outputstream, recordsForEachStream some other name</technical_language>

Target:
public Map<String, TestRunSink> testRunTopology(Topology topology, String configJson) throws Exception { TopologyDag dag = topologyDagBuilder.getDag(topology); topology.setTopologyDag(dag); ensureValid(dag); TopologyActions topologyActions = getTopologyActionsInstance(topology); LOG.debug("Running topology in test mode", topology); setUpClusterArtifacts(topology, topologyActions); String mavenArtifacts = setUpExtraJars(topology, topologyActions); ObjectMapper objectMapper = new ObjectMapper(); Map<String, Map<String, List<Map<String, Object>>>> testRecordsForEachSource = objectMapper.readValue(configJson, new TypeReference<Map<String, Map<String, List<Map<String, Object>>>>>() {}); List<StreamlineSource> sources = dag.getOutputComponents().stream() .filter(c -> c instanceof StreamlineSource) .map(c -> (StreamlineSource) c) .collect(toList()); List<StreamlineSink> sinks = dag.getInputComponents().stream() .filter(c -> c instanceof StreamlineSink) .map(c -> (StreamlineSink) c) .collect(toList()); Map<String, TestRunSource> testRunSourceMap = sources.stream() .collect(toMap(s -> s.getName(), s -> new TestRunSource(s.getOutputStreams(), testRecordsForEachSource.get(s.getName())))); Map<String, TestRunSink> testRunSinkMap = sinks.stream() .collect(toMap(s -> s.getName(), s -> { String uuid = UUID.randomUUID().toString(); return new TestRunSink(uuid, getTopologyTestRunResult(uuid)); })); TopologyLayout topologyLayout = CatalogToLayoutConverter.getTopologyLayout(topology, dag); topologyActions.testRun(topologyLayout, mavenArtifacts, testRunSourceMap, testRunSinkMap); return testRunSinkMap; }