From 51d1b4130836ce1ce8c463dfa3532a7c20c72af0 Mon Sep 17 00:00:00 2001 From: Phillip Kruger Date: Wed, 2 Aug 2023 13:30:28 +1000 Subject: [PATCH] Remove Old Dev UI: Core Dev Services Signed-off-by: Phillip Kruger --- .../devmode/console/DevConsoleProcessor.java | 6 -- .../main/resources/dev-templates/index.html | 6 -- .../dev-services.html | 57 ------------------- .../io/quarkus/devui/DevServicesTest.java | 28 +++++++++ .../DevConsoleDevServicesSmokeTest.java | 33 ----------- 5 files changed, 28 insertions(+), 102 deletions(-) delete mode 100644 extensions/vertx-http/deployment/src/main/resources/dev-templates/io.quarkus.quarkus-vertx-http/dev-services.html create mode 100644 extensions/vertx-http/deployment/src/test/java/io/quarkus/devui/DevServicesTest.java delete mode 100644 integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleDevServicesSmokeTest.java diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsoleProcessor.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsoleProcessor.java index f70d7def67025..94a5c360009a0 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsoleProcessor.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevConsoleProcessor.java @@ -52,7 +52,6 @@ import io.quarkus.deployment.builditem.WebSocketLogHandlerBuildItem; import io.quarkus.deployment.console.ConsoleCommand; import io.quarkus.deployment.console.ConsoleStateManager; -import io.quarkus.deployment.dev.devservices.DevServiceDescriptionBuildItem; import io.quarkus.deployment.ide.EffectiveIdeBuildItem; import io.quarkus.deployment.ide.Ide; import io.quarkus.deployment.logging.LoggingSetupBuildItem; @@ -435,11 +434,6 @@ public void setupDevConsoleRoutes( } } - @BuildStep(onlyIf = { IsDevelopment.class }) - public DevConsoleTemplateInfoBuildItem config(List serviceDescriptions) { - return new DevConsoleTemplateInfoBuildItem("devServices", serviceDescriptions); - } - @Record(ExecutionTime.RUNTIME_INIT) @Consume(LoggingSetupBuildItem.class) @BuildStep(onlyIf = IsDevelopment.class) diff --git a/extensions/vertx-http/deployment/src/main/resources/dev-templates/index.html b/extensions/vertx-http/deployment/src/main/resources/dev-templates/index.html index a3de5675e993c..0df89eb6d8d4b 100644 --- a/extensions/vertx-http/deployment/src/main/resources/dev-templates/index.html +++ b/extensions/vertx-http/deployment/src/main/resources/dev-templates/index.html @@ -38,12 +38,6 @@ Config Editor

-

- - - Dev Services - -

diff --git a/extensions/vertx-http/deployment/src/main/resources/dev-templates/io.quarkus.quarkus-vertx-http/dev-services.html b/extensions/vertx-http/deployment/src/main/resources/dev-templates/io.quarkus.quarkus-vertx-http/dev-services.html deleted file mode 100644 index 8faed142810e0..0000000000000 --- a/extensions/vertx-http/deployment/src/main/resources/dev-templates/io.quarkus.quarkus-vertx-http/dev-services.html +++ /dev/null @@ -1,57 +0,0 @@ -{#include main fluid=true} -{#title}Dev Services{/title} -{#body} - -{#if info:devServices} -
- {#for service in info:devServices} -
-
-
- {service.name} -
-
- {#if service.containerInfo} -
    -
  • - {service.containerInfo.getShortId()} {service.containerInfo.formatNames()} -
  • -
  • - {service.containerInfo.imageName} -
  • -
  • - {service.containerInfo.formatNetworks()} -
  • -
  • - {service.containerInfo.formatPorts()} -
  • -
-
- {/if} -
Config
- - {#for config in service.configs} - {config.key}={config.value} -
- {/for} -
-
- -
-
- {/for} -
- {#else} -
-
-

You do not have any Dev Services running

- Read more about Dev Services -
-
- - {/if} - -{/body} -{/include} diff --git a/extensions/vertx-http/deployment/src/test/java/io/quarkus/devui/DevServicesTest.java b/extensions/vertx-http/deployment/src/test/java/io/quarkus/devui/DevServicesTest.java new file mode 100644 index 0000000000000..5d4c489e44308 --- /dev/null +++ b/extensions/vertx-http/deployment/src/test/java/io/quarkus/devui/DevServicesTest.java @@ -0,0 +1,28 @@ +package io.quarkus.devui; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import com.fasterxml.jackson.databind.JsonNode; + +import io.quarkus.devui.tests.DevUIBuildTimeDataTest; +import io.quarkus.test.QuarkusDevModeTest; + +public class DevServicesTest extends DevUIBuildTimeDataTest { + + @RegisterExtension + static final QuarkusDevModeTest config = new QuarkusDevModeTest().withEmptyApplication(); + + public DevServicesTest() { + super("devui"); + } + + @Test + public void testGetExtensions() throws Exception { + JsonNode devServicesResponse = super.getBuildTimeData("devServices"); + Assertions.assertNotNull(devServicesResponse); + Assertions.assertTrue(devServicesResponse.isArray()); + } + +} diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleDevServicesSmokeTest.java b/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleDevServicesSmokeTest.java deleted file mode 100644 index e07a8c4da84fb..0000000000000 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleDevServicesSmokeTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.quarkus.test.devconsole; - -import org.hamcrest.Matchers; -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 DevConsoleDevServicesSmokeTest { - - @RegisterExtension - static final QuarkusDevModeTest config = new QuarkusDevModeTest() - .withEmptyApplication(); - - @Test - public void testDevConsoleNotBroken() { - RestAssured.with() - .get("q/dev-v1") - .then() - .statusCode(200).body(Matchers.containsString("Dev Services")); - - RestAssured.with() - .get("q/dev-v1/io.quarkus.quarkus-vertx-http/dev-services") - .then() - .statusCode(200).body(Matchers.containsString("Dev Services")); - - } -}