You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/10/17 08:46:40 UTC

(camel) branch fix/milo-server-cert-test-bad-value updated: CAMEL-25645: camel-milo - ServerCertificateValidationTest writes the value before the consumers start

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

davsclaus pushed a commit to branch fix/milo-server-cert-test-bad-value
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/fix/milo-server-cert-test-bad-value by this push:
     new fe56d8f81874 CAMEL-25645: camel-milo - ServerCertificateValidationTest writes the value before the consumers start
fe56d8f81874 is described below

commit fe56d8f81874f4fde23d782fd133d1bdf85f9c3b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Oct 17 10:45:50 2026 +0200

    CAMEL-25645: camel-milo - ServerCertificateValidationTest writes the value before the consumers start
    
    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.
    
    Co-Authored-By: Claude Opus 5.5 (1M context) <no...@anthropic.com>
    Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
 .../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);