forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calculate Kafka dev ui RPC path from current window, for custom http …
…root path Fixes quarkusio#30029 (cherry picked from commit 7093aa6)
- Loading branch information
1 parent
81edd04
commit 1b26430
Showing
4 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
extensions/kafka-client/deployment/src/main/resources/dev-static/js/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
export const api = '/q/dev/io.quarkus.quarkus-kafka-client/kafka-admin'; | ||
export const api = () => { | ||
let path = window.location.pathname | ||
return path.replace('/kafka-dev-ui', '/kafka-admin') | ||
} | ||
export const ui = 'kafka-ui'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...tion-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleKafkaSmokeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.quarkus.test.devconsole; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusDevModeTest; | ||
import io.restassured.RestAssured; | ||
|
||
/** | ||
* Note that this test cannot be placed under the relevant {@code -deployment} module because then the DEV UI processor would | ||
* not be able to locate the template resources correctly. | ||
*/ | ||
public class DevConsoleKafkaSmokeTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusDevModeTest config = new QuarkusDevModeTest() | ||
.withApplicationRoot( | ||
(jar) -> jar.addAsResource(new StringAsset("quarkus.http.root-path=testing"), "application.properties")); | ||
|
||
@Test | ||
public void testServices() { | ||
RestAssured.get("testing/q/dev/io.quarkus.quarkus-kafka-client/kafka-dev-ui") | ||
.then() | ||
.statusCode(200).body(Matchers.containsString("Kafka Dev UI")); | ||
} | ||
|
||
} |