jamesnetherton commented on code in PR #3747:
URL: https://github.com/apache/camel-quarkus/pull/3747#discussion_r858532129


##########
integration-tests/infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/InfinispanResources.java:
##########
@@ -198,16 +232,24 @@ public void putAllAsync(@QueryParam("component") String 
component)
     }
 
     @Path("/putIdempotent")
-    @POST
-    @Consumes(MediaType.TEXT_PLAIN)
-    public void putIdempotent(
-            @QueryParam("component") String component,
-            @QueryParam("messageId") String messageId,
-            String content) {
+    @GET
+    public void putIdempotent(@QueryParam("component") String component) 
throws InterruptedException {
+        MockEndpoint mockEndpoint = 
camelContext.getEndpoint("mock:resultIdempotent", MockEndpoint.class);
+        mockEndpoint.expectedMessageCount(1);
+
+        String messageId = UUID.randomUUID().toString();
         String uri = component.equals("infinispan") ? "direct:camelIdempotent" 
: "direct:quarkusIdempotent";
-        Map<String, Object> headers = getCommonHeaders(component);
-        headers.put("MessageId", messageId);
-        template.sendBodyAndHeaders(uri, content, headers);
+        try {
+            IntStream.of(1, 10).forEach(value -> {
+                Map<String, Object> headers = getCommonHeaders(component);
+                headers.put("MessageId", messageId);
+                template.sendBodyAndHeaders(uri, "Message " + value, headers);
+            });
+
+            mockEndpoint.assertIsSatisfied(5000);
+        } finally {
+            mockEndpoint.reset();

Review Comment:
   I've tweaked things to `use single use endpoint by integrating component 
name`. There are some other extension tests like this that I'd like to modify. 
So makes sense to have a consistent approach.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to