diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/NativeTestExtension.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/NativeTestExtension.java index b652c8f14878c..7bad1f6b6cd01 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/NativeTestExtension.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/NativeTestExtension.java @@ -132,9 +132,10 @@ private IntegrationTestExtensionState doNativeStart(ExtensionContext context, Cl hasPerTestResources = testResourceManager.hasPerTestResources(); Map additionalProperties = new HashMap<>(testProfileAndProperties.properties); - additionalProperties.putAll(devServicesProps); - Map resourceManagerProps = testResourceManager.start(); + Map resourceManagerProps = new HashMap<>(testResourceManager.start()); + resourceManagerProps.putAll(devServicesProps); Map old = new HashMap<>(); + //we also make the dev services config accessible from the test itself for (Map.Entry i : resourceManagerProps.entrySet()) { old.put(i.getKey(), System.getProperty(i.getKey())); if (i.getValue() == null) { @@ -157,6 +158,7 @@ public void close() throws Throwable { } } }); + //this includes dev services props additionalProperties.putAll(resourceManagerProps); NativeImageLauncher launcher = createLauncher(requiredTestClass); diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusIntegrationTestExtension.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusIntegrationTestExtension.java index 863edbaff2a40..627c70235cfdf 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusIntegrationTestExtension.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusIntegrationTestExtension.java @@ -163,8 +163,9 @@ private IntegrationTestExtensionState doProcessStart(Properties quarkusArtifactP hasPerTestResources = testResourceManager.hasPerTestResources(); Map additionalProperties = new HashMap<>(testProfileAndProperties.properties); - additionalProperties.putAll(QuarkusIntegrationTestExtension.devServicesProps); - Map resourceManagerProps = testResourceManager.start(); + Map resourceManagerProps = new HashMap<>(testResourceManager.start()); + //we also make the dev services config accessible from the test itself + resourceManagerProps.putAll(QuarkusIntegrationTestExtension.devServicesProps); Map old = new HashMap<>(); for (Map.Entry i : resourceManagerProps.entrySet()) { old.put(i.getKey(), System.getProperty(i.getKey())); diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainIntegrationTestExtension.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainIntegrationTestExtension.java index aed5af5a8ea86..46cb159e63dca 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainIntegrationTestExtension.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainIntegrationTestExtension.java @@ -123,8 +123,9 @@ private ArtifactLauncher.LaunchResult doProcessStart(ExtensionContext context, S testProfileAndProperties.testProfile != null ? testProfileAndProperties.testProfile.getClass().getName() : null); Map additionalProperties = new HashMap<>(testProfileAndProperties.properties); - additionalProperties.putAll(QuarkusMainIntegrationTestExtension.devServicesProps); - Map resourceManagerProps = testResourceManager.start(); + Map resourceManagerProps = new HashMap<>(testResourceManager.start()); + //also make the dev services props accessible from the test + resourceManagerProps.putAll(QuarkusMainIntegrationTestExtension.devServicesProps); for (Map.Entry i : resourceManagerProps.entrySet()) { old.put(i.getKey(), System.getProperty(i.getKey())); if (i.getValue() == null) {