From fa7719550cc0a89857c9e79a2a175226c5024ce6 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 8 Sep 2021 08:23:03 +0200 Subject: [PATCH] Enable tests for QUARKUS-1218: Regression issue for @ConfigMapping The issue https://github.com/quarkusio/quarkus/issues/19448 was fixed by https://github.com/quarkusio/quarkus/pull/19937 --- .../spring/cloud/config/ConfigMappingGreetingResource.java | 4 ++-- .../quarkus/ts/spring/cloud/config/CustomMessageConfig.java | 5 +++-- .../quarkus/ts/spring/cloud/config/SpringCloudConfigIT.java | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/spring/spring-cloud-config/src/main/java/io/quarkus/ts/spring/cloud/config/ConfigMappingGreetingResource.java b/spring/spring-cloud-config/src/main/java/io/quarkus/ts/spring/cloud/config/ConfigMappingGreetingResource.java index 9eb534b21..0d7c7f5db 100644 --- a/spring/spring-cloud-config/src/main/java/io/quarkus/ts/spring/cloud/config/ConfigMappingGreetingResource.java +++ b/spring/spring-cloud-config/src/main/java/io/quarkus/ts/spring/cloud/config/ConfigMappingGreetingResource.java @@ -1,13 +1,13 @@ package io.quarkus.ts.spring.cloud.config; +import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; @Path("/custom-mapping/hello") public class ConfigMappingGreetingResource { - // TODO Disabled because https://github.com/quarkusio/quarkus/issues/19448 - // @Inject + @Inject CustomMessageConfig config; @GET diff --git a/spring/spring-cloud-config/src/main/java/io/quarkus/ts/spring/cloud/config/CustomMessageConfig.java b/spring/spring-cloud-config/src/main/java/io/quarkus/ts/spring/cloud/config/CustomMessageConfig.java index 15c53747d..7513b3392 100644 --- a/spring/spring-cloud-config/src/main/java/io/quarkus/ts/spring/cloud/config/CustomMessageConfig.java +++ b/spring/spring-cloud-config/src/main/java/io/quarkus/ts/spring/cloud/config/CustomMessageConfig.java @@ -1,7 +1,8 @@ package io.quarkus.ts.spring.cloud.config; -// TODO Disabled because https://github.com/quarkusio/quarkus/issues/19448 -// @ConfigMapping(prefix = "custom") +import io.smallrye.config.ConfigMapping; + +@ConfigMapping(prefix = "custom") public interface CustomMessageConfig { String message(); diff --git a/spring/spring-cloud-config/src/test/java/io/quarkus/ts/spring/cloud/config/SpringCloudConfigIT.java b/spring/spring-cloud-config/src/test/java/io/quarkus/ts/spring/cloud/config/SpringCloudConfigIT.java index 8541e77e9..1e56faef9 100644 --- a/spring/spring-cloud-config/src/test/java/io/quarkus/ts/spring/cloud/config/SpringCloudConfigIT.java +++ b/spring/spring-cloud-config/src/test/java/io/quarkus/ts/spring/cloud/config/SpringCloudConfigIT.java @@ -3,6 +3,7 @@ import static org.hamcrest.Matchers.is; import org.apache.http.HttpStatus; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -24,8 +25,9 @@ public class SpringCloudConfigIT { .withProperty("quarkus.profile", "SpringCloudConfigIT") .withProperty("quarkus.spring-cloud-config.url", () -> spring.getHost() + ":" + spring.getPort()); + @Tag("QUARKUS-1218") @ParameterizedTest - @ValueSource(strings = { "/jaxrs", "/spring" }) // TODO Disabled because https://github.com/quarkusio/quarkus/issues/19448: "/custom-mapping" }) + @ValueSource(strings = { "/jaxrs", "/spring", "/custom-mapping" }) public void shouldGetExpectedHelloMessage(String rootPath) { app.given().get(rootPath + "/hello").then() .statusCode(HttpStatus.SC_OK)