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

apupier 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 f70e260ea08e Fix DuckDbProducerIT test
f70e260ea08e is described below

commit f70e260ea08eb51f93559ef2fda6b8455af133d3
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Tue Aug 25 09:14:26 2026 +0200

    Fix DuckDbProducerIT test
    
    the regression was introduced by
    
https://github.com/apache/camel/commit/bb6882f9f2f041015227f874fb4b51910d09ee9c
    
    an encapsulation was created thus the instanceof check was not working
    anymore
    
    the error message was:
    
    ```
    org.apache.camel.CamelExecutionException: Exception occurred during
    execution on the exchange: Exchange[E0AFAC2934D1620-0000000000000000]
            at 
org.apache.camel.CamelExecutionException.wrapCamelExecutionException(CamelExecutionException.java:60)
            at 
org.apache.camel.support.ExchangeHelper.extractResultBody(ExchangeHelper.java:704)
            at 
org.apache.camel.impl.engine.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:594)
            at 
org.apache.camel.impl.engine.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:590)
            at 
org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:188)
            at 
org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:194)
            at 
org.apache.camel.component.duckdb.integration.DuckDbProducerIT.insertAndQueryRoundTrip(DuckDbProducerIT.java:77)
    Caused by: java.sql.SQLException: Catalog Error: Table with name
    camel_events does not exist!
    Did you mean "pg_class"?
            at org.duckdb.DuckDBNative.duckdb_jdbc_prepare(Native Method)
            at 
org.duckdb.DuckDBPreparedStatement.prepare(DuckDBPreparedStatement.java:155)
            at 
org.duckdb.DuckDBPreparedStatement.<init>(DuckDBPreparedStatement.java:90)
            at 
org.duckdb.DuckDBConnection.prepareStatement(DuckDBConnection.java:121)
            at 
org.duckdb.DuckDBConnection.prepareStatement(DuckDBConnection.java:306)
            at 
org.apache.camel.component.duckdb.DuckDbInsertSupport.insertMaps(DuckDbInsertSupport.java:47)
    ```
    
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 .../camel/component/duckdb/integration/DuckDbProducerIT.java      | 8 +++++++-
 .../camel/test/infra/duckdb/services/DuckDbServiceFactory.java    | 7 ++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-duckdb/src/test/java/org/apache/camel/component/duckdb/integration/DuckDbProducerIT.java
 
b/components/camel-duckdb/src/test/java/org/apache/camel/component/duckdb/integration/DuckDbProducerIT.java
index e28eb5ac5f1d..70db3cf07bb5 100644
--- 
a/components/camel-duckdb/src/test/java/org/apache/camel/component/duckdb/integration/DuckDbProducerIT.java
+++ 
b/components/camel-duckdb/src/test/java/org/apache/camel/component/duckdb/integration/DuckDbProducerIT.java
@@ -41,7 +41,13 @@ class DuckDbProducerIT extends CamelTestSupport {
 
     @BeforeEach
     void setUpDatabase() throws Exception {
-        if (service instanceof DuckDbEmbeddedService embedded) {
+        DuckDbService duckDbService;
+        if (DuckDbProducerIT.service instanceof 
DuckDbServiceFactory.SingletonDuckDbService singleton) {
+            duckDbService = singleton.getService();
+        } else {
+            duckDbService = DuckDbProducerIT.service;
+        }
+        if (duckDbService instanceof DuckDbEmbeddedService embedded) {
             embedded.executeSql("CREATE TABLE IF NOT EXISTS camel_events (id 
INTEGER, name VARCHAR)");
             embedded.executeSql("DELETE FROM camel_events");
         }
diff --git 
a/test-infra/camel-test-infra-duckdb/src/main/java/org/apache/camel/test/infra/duckdb/services/DuckDbServiceFactory.java
 
b/test-infra/camel-test-infra-duckdb/src/main/java/org/apache/camel/test/infra/duckdb/services/DuckDbServiceFactory.java
index 280570f3bc93..744cd109ddf9 100644
--- 
a/test-infra/camel-test-infra-duckdb/src/main/java/org/apache/camel/test/infra/duckdb/services/DuckDbServiceFactory.java
+++ 
b/test-infra/camel-test-infra-duckdb/src/main/java/org/apache/camel/test/infra/duckdb/services/DuckDbServiceFactory.java
@@ -21,7 +21,7 @@ import 
org.apache.camel.test.infra.common.services.SingletonService;
 
 public final class DuckDbServiceFactory {
 
-    private static class SingletonDuckDbService extends 
SingletonService<DuckDbService> implements DuckDbService {
+    public static class SingletonDuckDbService extends 
SingletonService<DuckDbService> implements DuckDbService {
         public SingletonDuckDbService(DuckDbService service, String name) {
             super(service, name);
         }
@@ -35,6 +35,11 @@ public final class DuckDbServiceFactory {
         public String getDatabasePath() {
             return getService().getDatabasePath();
         }
+
+        @Override
+        public DuckDbService getService() {
+            return super.getService();
+        }
     }
 
     private DuckDbServiceFactory() {

Reply via email to