Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/dbclient/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@
<artifactId>helidon-webclient</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.testing</groupId>
<artifactId>helidon-testing-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -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");
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -29,6 +31,7 @@

import static io.helidon.config.ConfigSources.classpath;

@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {

Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -30,6 +32,7 @@

import static io.helidon.config.ConfigSources.classpath;

@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {

Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -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");
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -28,6 +30,7 @@

import static io.helidon.config.ConfigSources.classpath;

@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
public class PokemonServiceMongoIT extends AbstractPokemonServiceTest {

Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -28,6 +30,7 @@

import static io.helidon.config.ConfigSources.classpath;

@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
public class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {

Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -30,6 +32,7 @@

import static io.helidon.config.ConfigSources.classpath;

@Testing.Test
@Testcontainers(disabledWithoutDocker = true)
public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {

Expand All @@ -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());
Expand Down
Loading