C0urante commented on code in PR #11983: URL: https://github.com/apache/kafka/pull/11983#discussion_r861366648
########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignorTest.java: ########## @@ -1142,107 +982,65 @@ private void removeConnector(String connector) { ); } - private void updateConfigSnapshot() { - when(coordinator.configSnapshot()).thenReturn(configState()); - } - private ClusterConfigState configState() { Map<String, Integer> taskCounts = new HashMap<>(connectors); - Map<String, Map<String, String>> connectorConfigs = taskCounts.keySet().stream().collect(Collectors.toMap( - Function.identity(), - connector -> Collections.emptyMap() - )); - Map<String, TargetState> targetStates = taskCounts.keySet().stream().collect(Collectors.toMap( - Function.identity(), - connector -> TargetState.STARTED - )); + Map<String, Map<String, String>> connectorConfigs = transformValues(taskCounts, c -> Collections.emptyMap()); + Map<String, TargetState> targetStates = transformValues(taskCounts, c -> TargetState.STARTED); Map<ConnectorTaskId, Map<String, String>> taskConfigs = taskCounts.entrySet().stream() .flatMap(e -> IntStream.range(0, e.getValue()).mapToObj(i -> new ConnectorTaskId(e.getKey(), i))) .collect(Collectors.toMap( Function.identity(), connectorTaskId -> Collections.emptyMap() )); return new ClusterConfigState( - offset, + 16, Review Comment: 👍 sounds good, done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org