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 2022/06/23 10:22:03 UTC

[camel] branch main updated: Enhance CamelTestSupport with a check to not run on quarkus (#7863)

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 dba5fd7a018 Enhance CamelTestSupport with a check to not run on quarkus (#7863)
dba5fd7a018 is described below

commit dba5fd7a018e7841547fdc3da47f15e091a1a10d
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Thu Jun 23 12:21:53 2022 +0200

    Enhance CamelTestSupport with a check to not run on quarkus (#7863)
---
 .../org/apache/camel/test/junit5/CamelTestSupport.java     | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
index c2843b29b28..536dbade208 100644
--- a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
+++ b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
@@ -378,6 +378,7 @@ public abstract class CamelTestSupport
         } else {
             // test is per test so always setup
             doSpringBootCheck();
+            doQuarkusCheck();
             setupResources();
             doPreSetup();
             doSetUp();
@@ -414,6 +415,19 @@ public abstract class CamelTestSupport
         }
     }
 
+    /**
+     * Detects if this is a Camel-quarkus test and throw an exception, as these base classes is not intended for testing
+     * Camel onQuarkus.
+     */
+    protected void doQuarkusCheck() {
+        boolean quarkus = hasClassAnnotation("io.quarkus.test.junit.QuarkusTest") ||
+                hasClassAnnotation("org.apache.camel.quarkus.test.CamelQuarkusTest");
+        if (quarkus) {
+            throw new RuntimeException(
+                    "Quarkus detected: The CamelTestSupport/CamelSpringTestSupport class is not intended for Camel testing with Quarkus.");
+        }
+    }
+
     protected void doSetUp() throws Exception {
         LOG.debug("setUp test");
         // jmx is enabled if we have configured to use it, if dump route coverage is enabled (it requires JMX) or if