Skip to content

Commit fe52f00

Browse files
committed
remove async call
1 parent b9fac4a commit fe52f00

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/components/camel-jetty/src/main/java/org/apache/karaf/camel/test/CamelJettyComponent.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class CamelJettyComponent extends AbstractCamelComponentResultMockBased {
3838

3939
@Override
4040
protected Function<RouteBuilder, RouteDefinition> consumerRoute() {
41-
return builder -> builder.from("jetty://http://localhost:%s/test".formatted(port)).transform(builder.constant("OK"));
41+
return builder -> builder.from("jetty://http://localhost:%s/jettyTest".formatted(port)).transform(builder.constant("OK"));
4242
}
4343

4444
@Override
@@ -55,16 +55,14 @@ public void process(Exchange exchange) throws Exception {
5555
HttpClient client = HttpClient.newHttpClient();
5656

5757
// Create a URI for the request
58-
URI uri = URI.create("http://localhost:%s/test".formatted(port));
58+
URI uri = URI.create("http://localhost:%s/jettyTest".formatted(port));
5959

6060
// Create a HttpRequest
6161
HttpRequest request = HttpRequest.newBuilder()
6262
.uri(uri)
6363
.build();
6464

65-
client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
66-
.thenApply(HttpResponse::body)
67-
.thenAccept(System.out::println);
65+
client.send(request, HttpResponse.BodyHandlers.ofString());
6866
}
6967
}
7068
}

0 commit comments

Comments
 (0)