This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new ac362f6f0c Fix Dev UI fetching of Camel console JSON data
ac362f6f0c is described below
commit ac362f6f0c54f86c006cc4c0f8a4eb21080a624d
Author: James Netherton <[email protected]>
AuthorDate: Tue Oct 14 13:30:49 2025 +0100
Fix Dev UI fetching of Camel console JSON data
Fixes #7830
---
extensions-core/core/deployment/pom.xml | 5 +++
.../src/main/resources/dev-ui/qwc-camel-core.js | 4 +-
.../devui/CamelQuarkusCoreDevUITest.java | 46 ++++++++++++++++++++++
3 files changed, 53 insertions(+), 2 deletions(-)
diff --git a/extensions-core/core/deployment/pom.xml
b/extensions-core/core/deployment/pom.xml
index e0124e5f6a..7b7d2d19fa 100644
--- a/extensions-core/core/deployment/pom.xml
+++ b/extensions-core/core/deployment/pom.xml
@@ -85,6 +85,11 @@
<artifactId>quarkus-junit5-internal</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-devui-test-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
diff --git
a/extensions-core/core/deployment/src/main/resources/dev-ui/qwc-camel-core.js
b/extensions-core/core/deployment/src/main/resources/dev-ui/qwc-camel-core.js
index 6cada58a56..e6f285855a 100644
---
a/extensions-core/core/deployment/src/main/resources/dev-ui/qwc-camel-core.js
+++
b/extensions-core/core/deployment/src/main/resources/dev-ui/qwc-camel-core.js
@@ -84,8 +84,8 @@ export class QwcCamelCore extends QwcHotReloadElement {
enableConsoleUpdates() {
// If we're being inherited from outside camel-quarkus-core this
allows JsonRpc calls to work
- if (this.jsonRpc.getExtensionName() !==
'org.apache.camel.quarkus.camel-quarkus-core') {
-
this.jsonRpc._setExtensionName('org.apache.camel.quarkus.camel-quarkus-core');
+ if (this.jsonRpc.getExtensionName() !== 'camel-quarkus-core') {
+ this.jsonRpc._setExtensionName('camel-quarkus-core');
}
// Fetch initial data
diff --git
a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/devui/CamelQuarkusCoreDevUITest.java
b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/devui/CamelQuarkusCoreDevUITest.java
new file mode 100644
index 0000000000..63708016f4
--- /dev/null
+++
b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/devui/CamelQuarkusCoreDevUITest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.core.deployment.devui;
+
+import java.util.Map;
+
+import io.quarkus.devui.tests.DevUIJsonRPCTest;
+import io.quarkus.test.QuarkusDevModeTest;
+import io.vertx.core.json.Json;
+import io.vertx.core.json.JsonObject;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class CamelQuarkusCoreDevUITest extends DevUIJsonRPCTest {
+ @RegisterExtension
+ static final QuarkusDevModeTest CONFIG = new
QuarkusDevModeTest().withEmptyApplication();
+
+ public CamelQuarkusCoreDevUITest() {
+ super("org.apache.camel.quarkus.camel-quarkus-core");
+ }
+
+ @Test
+ void getCamelContextDevConsoleJSON() throws Exception {
+ String result = super.executeJsonRPCMethod(String.class,
"getConsoleJSON",
+ Map.of("id", "context", "options", Map.of()));
+ JsonObject json = (JsonObject) Json.decodeValue(result);
+ assertEquals("camel-1", json.getString("name"));
+ assertEquals("Started", json.getString("state"));
+ }
+}