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


##########
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'm just wondering whether it would generally be better practice to have 
single usage mock endpoint where possible. In this PR, maybe we could have 
single use endpoint by integrating component name in the mock uri
   
   Would that maybe not be a good idea at the moment given that this is not 
fixed till Camel 3.17?
   
   https://issues.apache.org/jira/browse/CAMEL-17948
   
   Just so I understand the problem, is it that `reset` can still be in 
progress while some other test is trying to do assertions on the mock endpoint? 



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