This is an automated email from the ASF dual-hosted git repository.

mjsax pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0cf2f0e55d7 MINOR: update KafkaStreamsTelemetryIntegrationTest for 
Java17 (#19567)
0cf2f0e55d7 is described below

commit 0cf2f0e55d79a710230a4b1dea1f022cfeb80f09
Author: Matthias J. Sax <[email protected]>
AuthorDate: Fri Apr 25 16:43:18 2025 -0700

    MINOR: update KafkaStreamsTelemetryIntegrationTest for Java17 (#19567)
    
    Reviewers: Bill Bejeck <[email protected]>
---
 .../streams/integration/KafkaStreamsTelemetryIntegrationTest.java  | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/KafkaStreamsTelemetryIntegrationTest.java
 
b/streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/KafkaStreamsTelemetryIntegrationTest.java
index 63ef1eb4ea8..0af02321a67 100644
--- 
a/streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/KafkaStreamsTelemetryIntegrationTest.java
+++ 
b/streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/KafkaStreamsTelemetryIntegrationTest.java
@@ -83,7 +83,6 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import static org.apache.kafka.common.utils.Utils.mkEntry;
@@ -236,7 +235,7 @@ public class KafkaStreamsTelemetryIntegrationTest {
                         final String group = mn.group().replace("-metrics", 
"").replace('-', '.');
                         return "org.apache.kafka." + group + "." + name;
                     }).filter(name -> 
!name.equals("org.apache.kafka.stream.thread.state"))// telemetry reporter 
filters out string metrics
-                    .sorted().collect(Collectors.toList());
+                    .sorted().toList();
             final List<String> actualMetrics = new 
ArrayList<>(TelemetryPlugin.SUBSCRIBED_METRICS.get(mainConsumerInstanceId));
             assertEquals(expectedMetrics, actualMetrics);
 
@@ -428,7 +427,7 @@ public class KafkaStreamsTelemetryIntegrationTest {
         return streams.metadataForLocalThreads().stream()
                 .flatMap(threadMeta -> threadMeta.activeTasks().stream()
                         .map(taskMeta -> taskMeta.taskId().toString()))
-                .collect(Collectors.toList());
+                .toList();
     }
 
     private static Stream<Arguments> singleAndMultiTaskParameters() {
@@ -626,7 +625,7 @@ public class KafkaStreamsTelemetryIntegrationTest {
                         .flatMap(sm -> sm.getMetricsList().stream())
                         
.map(org.apache.kafka.shaded.io.opentelemetry.proto.metrics.v1.Metric::getName)
                         .sorted()
-                        .collect(Collectors.toList());
+                        .toList();
                 LOG.info("Found metrics {} for clientId={}", metricNames, 
clientId);
                 SUBSCRIBED_METRICS.put(clientId, metricNames);
             } catch (final Exception e) {

Reply via email to