chia7712 commented on code in PR #20156:
URL: https://github.com/apache/kafka/pull/20156#discussion_r2254949942


##########
connect/runtime/src/test/java/org/apache/kafka/connect/integration/OffsetsApiIntegrationTest.java:
##########
@@ -602,8 +601,8 @@ public void 
alterAndVerifySourceConnectorOffsets(Map<String, String> connectorCo
         // The TestableSourceConnector has a source partition per task
         for (int i = 0; i < NUM_TASKS; i++) {
             offsetsToAlter.add(
-                    new ConnectorOffset(Collections.singletonMap("task.id", 
connectorName + "-" + i),
-                            Collections.singletonMap("saved", 5))
+                    new ConnectorOffset(Map.of("task.id", connectorName + "-" 
+ i),

Review Comment:
   ```java
   offsets.add(new ConnectorOffset(Map.of("task.id", connectorName + "-" + i), 
Map.of("saved", 5)));
   ```



##########
connect/runtime/src/test/java/org/apache/kafka/connect/integration/OffsetsApiIntegrationTest.java:
##########
@@ -623,8 +622,8 @@ public void 
alterAndVerifySourceConnectorOffsets(Map<String, String> connectorCo
         // The TestableSourceConnector has a source partition per task
         for (int i = 0; i < NUM_TASKS; i++) {
             offsetsToAlter.add(
-                    new ConnectorOffset(Collections.singletonMap("task.id", 
connectorName + "-" + i),
-                            Collections.singletonMap("saved", 7))
+                    new ConnectorOffset(Map.of("task.id", connectorName + "-" 
+ i),

Review Comment:
   ```java
   offsetsToAlter.add(new ConnectorOffset(Map.of("task.id", connectorName + "-" 
+ i), Map.of("saved", 7)));
   ```



##########
connect/runtime/src/test/java/org/apache/kafka/connect/integration/RebalanceSourceConnectorsIntegrationTest.java:
##########
@@ -351,7 +351,7 @@ private static String formatAssignment(Map<String, 
Collection<String>> assignmen
         StringBuilder result = new StringBuilder();
         for (String worker : assignment.keySet().stream().sorted().toList()) {
             result.append(String.format("\n%s=%s", worker, 
assignment.getOrDefault(worker,
-                    Collections.emptyList())));

Review Comment:
   ```java
   result.append(String.format("\n%s=%s", worker, 
assignment.getOrDefault(worker, List.of())));
   ```



##########
connect/runtime/src/test/java/org/apache/kafka/connect/integration/OffsetsApiIntegrationTest.java:
##########
@@ -304,8 +303,8 @@ public void testAlterOffsetsNonStoppedConnector() throws 
Exception {
         // The TestableSourceConnector has a source partition per task
         for (int i = 0; i < NUM_TASKS; i++) {
             offsets.add(
-                    new ConnectorOffset(Collections.singletonMap("task.id", 
connectorName + "-" + i),
-                            Collections.singletonMap("saved", 5))
+                    new ConnectorOffset(Map.of("task.id", connectorName + "-" 
+ i),

Review Comment:
   ```java
   offsetsToAlter.add(new ConnectorOffset(Map.of("task.id", connectorName + "-" 
+ i), Map.of("saved", 5)));
   ```



-- 
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

Reply via email to