diff --git a/core/runtime/src/main/java/io/quarkus/runtime/configuration/QuarkusConfigFactory.java b/core/runtime/src/main/java/io/quarkus/runtime/configuration/QuarkusConfigFactory.java index 539c1a4bbf373..0ea4c1503e66a 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/configuration/QuarkusConfigFactory.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/configuration/QuarkusConfigFactory.java @@ -28,8 +28,11 @@ public SmallRyeConfig getConfigFor(final SmallRyeConfigProviderResolver configPr //the HTTP port or logging info return configProviderResolver.getBuilder().forClassLoader(classLoader) .addDefaultSources() + .addDefaultInterceptors() .addDiscoveredSources() .addDiscoveredConverters() + .addDiscoveredInterceptors() + .withProfile(ProfileManager.getActiveProfile()) .build(); } return config; diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/http/TestHTTPConfigSourceProvider.java b/test-framework/common/src/main/java/io/quarkus/test/common/http/TestHTTPConfigSourceProvider.java index 4d4c61e2e902f..463e9fc5c08ae 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/http/TestHTTPConfigSourceProvider.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/http/TestHTTPConfigSourceProvider.java @@ -25,6 +25,8 @@ public class TestHTTPConfigSourceProvider implements ConfigSourceProvider { Map map = new HashMap<>(); map.put(TEST_URL_KEY, sanitizeURL(TEST_URL_VALUE)); map.put(TEST_URL_SSL_KEY, sanitizeURL(TEST_URL_SSL_VALUE)); + map.put("%dev." + TEST_URL_KEY, sanitizeURL( + "http://${quarkus.http.host:localhost}:${quarkus.http.test-port:8080}${quarkus.servlet.context-path:}")); entries = Collections.unmodifiableMap(map); } diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/http/TestHTTPResourceManager.java b/test-framework/common/src/main/java/io/quarkus/test/common/http/TestHTTPResourceManager.java index 4cf897443d072..bad5a28ac4aed 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/http/TestHTTPResourceManager.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/http/TestHTTPResourceManager.java @@ -20,14 +20,7 @@ public class TestHTTPResourceManager { public static String getUri() { try { Config config = ConfigProvider.getConfig(); - String value = config.getValue("test.url", String.class); - if (value.equals(TestHTTPConfigSourceProvider.TEST_URL_VALUE)) { - //massive hack for dev mode tests, dev mode has not started yet - //so we don't have any way to load this correctly from config - return "http://" + config.getOptionalValue("quarkus.http.host", String.class).orElse("localhost") + ":" - + config.getOptionalValue("quarkus.http.port", String.class).orElse("8080"); - } - return value; + return config.getValue("test.url", String.class); } catch (IllegalStateException e) { //massive hack for dev mode tests, dev mode has not started yet //so we don't have any way to load this correctly from config