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

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git

commit 14ffcede2a7e7f52ba6c8e7ddf43f3a7dfc1d399
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Thu May 20 09:09:14 2021 +0200

    Adjusted route output inspector to match API changes from Camel 3.10
---
 .../org/apache/camel/k/runtime/support/RuntimeInspector.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/support/camel-k-itests-support/camel-k-itests-runtime-inspector/src/main/java/org/apache/camel/k/runtime/support/RuntimeInspector.java
 
b/support/camel-k-itests-support/camel-k-itests-runtime-inspector/src/main/java/org/apache/camel/k/runtime/support/RuntimeInspector.java
index c53adcf..97b8df8 100644
--- 
a/support/camel-k-itests-support/camel-k-itests-runtime-inspector/src/main/java/org/apache/camel/k/runtime/support/RuntimeInspector.java
+++ 
b/support/camel-k-itests-support/camel-k-itests-runtime-inspector/src/main/java/org/apache/camel/k/runtime/support/RuntimeInspector.java
@@ -17,6 +17,7 @@
 package org.apache.camel.k.runtime.support;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -99,12 +100,11 @@ public class RuntimeInspector {
             throw new IllegalArgumentException("RouteDefinition with name: " + 
name + " not found");
         }
 
-        List<String> endpoints = new ArrayList<>();
+        Collection<ToDefinition> toDefinitions = 
filterTypeInOutputs(def.getOutputs(), ToDefinition.class);
 
-        Iterator<ToDefinition> it = filterTypeInOutputs(def.getOutputs(), 
ToDefinition.class);
-        while (it.hasNext()) {
-            endpoints.add(it.next().getEndpointUri());
-        }
+        List<String> endpoints = toDefinitions.stream()
+                .map(td -> td.getEndpointUri())
+                .collect(Collectors.toList());
 
         return Json.createArrayBuilder(endpoints).build();
     }

Reply via email to