diff --git a/examples/dbclient/jdbc/pom.xml b/examples/dbclient/jdbc/pom.xml
index 9760f8478..c729fb03e 100644
--- a/examples/dbclient/jdbc/pom.xml
+++ b/examples/dbclient/jdbc/pom.xml
@@ -162,6 +162,11 @@
helidon-webclient
test
+
+ io.helidon.testing
+ helidon-testing-junit5
+ test
+
org.junit.jupiter
junit-jupiter-api
diff --git a/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceH2IT.java b/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceH2IT.java
index 7f5c8dee1..2a6351de5 100644
--- a/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceH2IT.java
+++ b/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceH2IT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024 Oracle and/or its affiliates.
+ * Copyright (c) 2023, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,8 @@
import io.helidon.config.Config;
import io.helidon.config.ConfigSources;
+import io.helidon.service.registry.Services;
+import io.helidon.testing.junit5.Testing;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.GenericContainer;
@@ -31,6 +33,7 @@
import static io.helidon.config.ConfigSources.classpath;
+@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
class PokemonServiceH2IT extends AbstractPokemonServiceTest {
private static final DockerImageName H2_IMAGE = DockerImageName.parse("nemerosa/h2");
@@ -43,7 +46,7 @@ class PokemonServiceH2IT extends AbstractPokemonServiceTest {
@BeforeAll
static void start() {
String url = String.format("jdbc:h2:tcp://localhost:%s/~./test", container.getMappedPort(9082));
- Config.global(Config.builder()
+ Services.set(Config.class, Config.builder()
.addSource(ConfigSources.create(Map.of("db.connection.url", url)))
.addSource(classpath("application-h2-test.yaml"))
.build());
diff --git a/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceMySQLIT.java b/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceMySQLIT.java
index eee51c64b..5583e71c3 100644
--- a/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceMySQLIT.java
+++ b/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceMySQLIT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024 Oracle and/or its affiliates.
+ * Copyright (c) 2023, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,8 @@
import io.helidon.config.Config;
import io.helidon.config.ConfigSources;
+import io.helidon.service.registry.Services;
+import io.helidon.testing.junit5.Testing;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.MySQLContainer;
@@ -29,6 +31,7 @@
import static io.helidon.config.ConfigSources.classpath;
+@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {
@@ -41,7 +44,7 @@ class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {
@BeforeAll
static void start() {
- Config.global(Config.builder()
+ Services.set(Config.class, Config.builder()
.addSource(ConfigSources.create(Map.of("db.connection.url", container.getJdbcUrl())))
.addSource(classpath("application-mysql-test.yaml"))
.build());
diff --git a/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceOracleIT.java b/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceOracleIT.java
index a37525049..1d4ac74c5 100644
--- a/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceOracleIT.java
+++ b/examples/dbclient/jdbc/src/test/java/io/helidon/examples/dbclient/jdbc/PokemonServiceOracleIT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024 Oracle and/or its affiliates.
+ * Copyright (c) 2024, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
import io.helidon.config.Config;
import io.helidon.config.ConfigSources;
+import io.helidon.service.registry.Services;
+import io.helidon.testing.junit5.Testing;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.OracleContainer;
@@ -30,6 +32,7 @@
import static io.helidon.config.ConfigSources.classpath;
+@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {
@@ -45,7 +48,7 @@ public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {
@BeforeAll
static void start() {
- Config.global(Config.builder()
+ Services.set(Config.class, Config.builder()
.addSource(ConfigSources.create(Map.of("db.connection.url", container.getJdbcUrl())))
.addSource(classpath("application-oracle-test.yaml"))
.build());
diff --git a/examples/dbclient/pokemons/src/main/java/io/helidon/examples/dbclient/pokemons/Main.java b/examples/dbclient/pokemons/src/main/java/io/helidon/examples/dbclient/pokemons/Main.java
index bf56292d7..321122aad 100644
--- a/examples/dbclient/pokemons/src/main/java/io/helidon/examples/dbclient/pokemons/Main.java
+++ b/examples/dbclient/pokemons/src/main/java/io/helidon/examples/dbclient/pokemons/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024 Oracle and/or its affiliates.
+ * Copyright (c) 2019, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
import io.helidon.dbclient.DbClient;
import io.helidon.dbclient.health.DbClientHealthCheck;
import io.helidon.logging.common.LogConfig;
+import io.helidon.service.registry.Services;
import io.helidon.webserver.WebServer;
import io.helidon.webserver.WebServerConfig;
import io.helidon.webserver.http.HttpRouting;
@@ -72,7 +73,7 @@ private static void startServer() {
// By default, this will pick up application.yaml from the classpath
Config config = mongo ? Config.create(ConfigSources.classpath(MONGO_CFG)) : Config.create();
- Config.global(config);
+ Services.set(Config.class, config);
WebServer server = setupServer(WebServer.builder())
.build()
diff --git a/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceH2IT.java b/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceH2IT.java
index 25774f174..0019c4b19 100644
--- a/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceH2IT.java
+++ b/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceH2IT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024 Oracle and/or its affiliates.
+ * Copyright (c) 2023, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
import io.helidon.config.Config;
import io.helidon.config.ConfigSources;
+import io.helidon.service.registry.Services;
+import io.helidon.testing.junit5.Testing;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.GenericContainer;
@@ -33,6 +35,7 @@
/**
* Tests {@link io.helidon.examples.dbclient.pokemons.PokemonService}.
*/
+@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
class PokemonServiceH2IT extends AbstractPokemonServiceTest {
private static final DockerImageName H2_IMAGE = DockerImageName.parse("nemerosa/h2");
@@ -45,7 +48,7 @@ class PokemonServiceH2IT extends AbstractPokemonServiceTest {
@BeforeAll
static void start() {
String url = String.format("jdbc:h2:tcp://localhost:%s/~./test", container.getMappedPort(9082));
- Config.global(Config.builder()
+ Services.set(Config.class, Config.builder()
.addSource(ConfigSources.create(Map.of("db.connection.url", url)))
.addSource(classpath("application-h2-test.yaml"))
.build());
diff --git a/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceMongoIT.java b/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceMongoIT.java
index d0013d565..287583f5e 100644
--- a/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceMongoIT.java
+++ b/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceMongoIT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024 Oracle and/or its affiliates.
+ * Copyright (c) 2024, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
import io.helidon.config.Config;
import io.helidon.config.ConfigSources;
+import io.helidon.service.registry.Services;
+import io.helidon.testing.junit5.Testing;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.MongoDBContainer;
@@ -28,6 +30,7 @@
import static io.helidon.config.ConfigSources.classpath;
+@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
public class PokemonServiceMongoIT extends AbstractPokemonServiceTest {
@@ -38,7 +41,7 @@ public class PokemonServiceMongoIT extends AbstractPokemonServiceTest {
@BeforeAll
static void start() {
String url = String.format("mongodb://127.0.0.1:%s/pokemon", container.getMappedPort(27017));
- Config.global(Config.builder()
+ Services.set(Config.class, Config.builder()
.addSource(ConfigSources.create(Map.of("db.connection.url", url)))
.addSource(classpath("application-mongo-test.yaml"))
.build());
diff --git a/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceMySQLIT.java b/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceMySQLIT.java
index 36d03ddc0..136c3be3c 100644
--- a/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceMySQLIT.java
+++ b/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceMySQLIT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024 Oracle and/or its affiliates.
+ * Copyright (c) 2023, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
import io.helidon.config.Config;
import io.helidon.config.ConfigSources;
+import io.helidon.service.registry.Services;
+import io.helidon.testing.junit5.Testing;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.MySQLContainer;
@@ -28,6 +30,7 @@
import static io.helidon.config.ConfigSources.classpath;
+@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
public class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {
@@ -40,7 +43,7 @@ public class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {
@BeforeAll
static void start() {
- Config.global(Config.builder()
+ Services.set(Config.class, Config.builder()
.addSource(ConfigSources.create(Map.of("db.connection.url", container.getJdbcUrl())))
.addSource(classpath("application-mysql-test.yaml"))
.build());
diff --git a/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceOracleIT.java b/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceOracleIT.java
index cf2d4f6d9..4a0f23122 100644
--- a/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceOracleIT.java
+++ b/examples/dbclient/pokemons/src/test/java/io/helidon/examples/dbclient/pokemons/PokemonServiceOracleIT.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024 Oracle and/or its affiliates.
+ * Copyright (c) 2024, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
import io.helidon.config.Config;
import io.helidon.config.ConfigSources;
+import io.helidon.service.registry.Services;
+import io.helidon.testing.junit5.Testing;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.OracleContainer;
@@ -30,6 +32,7 @@
import static io.helidon.config.ConfigSources.classpath;
+@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {
@@ -45,7 +48,7 @@ public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {
@BeforeAll
static void setup() {
- Config.global(Config.builder()
+ Services.set(Config.class, Config.builder()
.addSource(ConfigSources.create(Map.of("db.connection.url", container.getJdbcUrl())))
.addSource(classpath("application-oracle-test.yaml"))
.build());