You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/10/24 09:03:14 UTC

[camel] branch main updated: CAMEL-18608: Fix test PooledExchangeTest

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

nfilotto pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 621c6a75390 CAMEL-18608: Fix test PooledExchangeTest
621c6a75390 is described below

commit 621c6a753909fbd4e825f14f16f7dc811302c981
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Mon Oct 24 11:02:25 2022 +0200

    CAMEL-18608: Fix test PooledExchangeTest
---
 .../test/java/org/apache/camel/processor/PooledExchangeTest.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/PooledExchangeTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/PooledExchangeTest.java
index e33c177aa1f..2165488872d 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/PooledExchangeTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/PooledExchangeTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.processor;
 
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -34,7 +35,7 @@ import org.junit.jupiter.api.Test;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertSame;
 
-public class PooledExchangeTest extends ContextTestSupport {
+class PooledExchangeTest extends ContextTestSupport {
 
     private final AtomicInteger counter = new AtomicInteger();
     private final AtomicReference<Exchange> ref = new AtomicReference<>();
@@ -51,7 +52,7 @@ public class PooledExchangeTest extends ContextTestSupport {
     }
 
     @Test
-    public void testSameExchange() throws Exception {
+    void testSameExchange() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(3);
         mock.expectedPropertyValuesReceivedInAnyOrder("myprop", 1, 3, 5);
@@ -62,7 +63,8 @@ public class PooledExchangeTest extends ContextTestSupport {
 
         context.getRouteController().startAllRoutes();
 
-        assertMockEndpointsSatisfied();
+        mock.setResultWaitTime(TimeUnit.MINUTES.toMillis(1));
+        mock.assertIsSatisfied();
 
         PooledObjectFactory.Statistics stat
                 = context.adapt(ExtendedCamelContext.class).getExchangeFactoryManager().getStatistics();