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

davsclaus 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 eb14b16f7006 CAMEL-25645: camel-milo - ServerCertificateValidationTest 
writes the value before the consumers start (#27999)
eb14b16f7006 is described below

commit eb14b16f700600fe244755a5960a293398942773
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Oct 17 15:30:01 2026 +0200

    CAMEL-25645: camel-milo - ServerCertificateValidationTest writes the value 
before the consumers start (#27999)
    
    Since CAMEL-25626 a consumer also delivers a null value with a Bad status, 
so
    a client that connected before the test wrote Foo received the initial Bad
    value of the item as well, and mock:trustAll got 2 messages. The two changes
    were merged on main 26 seconds apart and neither PR build ran with the 
other.
    
    The consumer routes now start after the value is written, as MonitorItemTest
    does since CAMEL-25626, so Foo is the first notification of each client.
    
    Signed-off-by: Claus Ibsen <[email protected]>
    Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
---
 .../component/milo/ServerCertificateValidationTest.java   | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-milo/src/test/java/org/apache/camel/component/milo/ServerCertificateValidationTest.java
 
b/components/camel-milo/src/test/java/org/apache/camel/component/milo/ServerCertificateValidationTest.java
index 98a822dd4085..12352d91f9c6 100644
--- 
a/components/camel-milo/src/test/java/org/apache/camel/component/milo/ServerCertificateValidationTest.java
+++ 
b/components/camel-milo/src/test/java/org/apache/camel/component/milo/ServerCertificateValidationTest.java
@@ -126,11 +126,13 @@ class ServerCertificateValidationTest extends 
AbstractMiloServerTest {
             public void configure() {
                 from(DIRECT_START).to(MILO_SERVER_ITEM);
 
-                from(resolve(trustListClient("trusted"))).to("mock:trustList");
-                
from(resolve(trustListClient("empty"))).to("mock:emptyTrustList");
-                from(resolve(MILO_CLIENT)).to("mock:notConfigured");
-                from(resolve(MILO_CLIENT + 
"&trustAllCertificates=true")).to("mock:trustAll");
-                from(resolve(MILO_CLIENT + 
"&certificateValidator=#recordingValidator")).to("mock:certificateValidator");
+                // the consumers deliver the current value while they start, 
so the test starts these routes
+                
from(resolve(trustListClient("trusted"))).autoStartup(false).to("mock:trustList");
+                
from(resolve(trustListClient("empty"))).autoStartup(false).to("mock:emptyTrustList");
+                
from(resolve(MILO_CLIENT)).autoStartup(false).to("mock:notConfigured");
+                from(resolve(MILO_CLIENT + 
"&trustAllCertificates=true")).autoStartup(false).to("mock:trustAll");
+                from(resolve(MILO_CLIENT + 
"&certificateValidator=#recordingValidator")).autoStartup(false)
+                        .to("mock:certificateValidator");
             }
         };
     }
@@ -146,7 +148,10 @@ class ServerCertificateValidationTest extends 
AbstractMiloServerTest {
         this.notConfiguredEndpoint.setExpectedCount(0);
         this.notConfiguredEndpoint.setSleepForEmptyTest(5_000);
 
+        // the value is written before the consumers start, so it is the first 
notification of each client that
+        // connects (and not the initial Bad value of the item)
         this.producer.sendBody("Foo");
+        context.getRouteController().startAllRoutes();
 
         MockEndpoint.assertIsSatisfied(context);
 

Reply via email to