File tree Expand file tree Collapse file tree 9 files changed +35
-8
lines changed
src/test/java/io/helidon/examples/dbclient/jdbc
main/java/io/helidon/examples/dbclient/pokemons
test/java/io/helidon/examples/dbclient/pokemons Expand file tree Collapse file tree 9 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 162162 <artifactId >helidon-webclient</artifactId >
163163 <scope >test</scope >
164164 </dependency >
165+ <dependency >
166+ <groupId >io.helidon.testing</groupId >
167+ <artifactId >helidon-testing-junit5</artifactId >
168+ <scope >test</scope >
169+ </dependency >
165170 <dependency >
166171 <groupId >org.junit.jupiter</groupId >
167172 <artifactId >junit-jupiter-api</artifactId >
Original file line number Diff line number Diff line change 2121import io .helidon .config .Config ;
2222import io .helidon .config .ConfigSources ;
2323
24+ import io .helidon .service .registry .Services ;
25+ import io .helidon .testing .junit5 .Testing ;
2426import org .junit .jupiter .api .AfterAll ;
2527import org .junit .jupiter .api .BeforeAll ;
2628import org .testcontainers .containers .GenericContainer ;
3133
3234import static io .helidon .config .ConfigSources .classpath ;
3335
36+ @ Testing .Test
3437@ Testcontainers (disabledWithoutDocker = true )
3538class PokemonServiceH2IT extends AbstractPokemonServiceTest {
3639 private static final DockerImageName H2_IMAGE = DockerImageName .parse ("nemerosa/h2" );
@@ -43,7 +46,7 @@ class PokemonServiceH2IT extends AbstractPokemonServiceTest {
4346 @ BeforeAll
4447 static void start () {
4548 String url = String .format ("jdbc:h2:tcp://localhost:%s/~./test" , container .getMappedPort (9082 ));
46- Config . global ( Config .builder ()
49+ Services . set ( Config . class , Config .builder ()
4750 .addSource (ConfigSources .create (Map .of ("db.connection.url" , url )))
4851 .addSource (classpath ("application-h2-test.yaml" ))
4952 .build ());
Original file line number Diff line number Diff line change 2121import io .helidon .config .Config ;
2222import io .helidon .config .ConfigSources ;
2323
24+ import io .helidon .service .registry .Services ;
25+ import io .helidon .testing .junit5 .Testing ;
2426import org .junit .jupiter .api .AfterAll ;
2527import org .junit .jupiter .api .BeforeAll ;
2628import org .testcontainers .containers .MySQLContainer ;
2931
3032import static io .helidon .config .ConfigSources .classpath ;
3133
34+ @ Testing .Test
3235@ Testcontainers (disabledWithoutDocker = true )
3336class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {
3437
@@ -41,7 +44,7 @@ class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {
4144
4245 @ BeforeAll
4346 static void start () {
44- Config . global ( Config .builder ()
47+ Services . set ( Config . class , Config .builder ()
4548 .addSource (ConfigSources .create (Map .of ("db.connection.url" , container .getJdbcUrl ())))
4649 .addSource (classpath ("application-mysql-test.yaml" ))
4750 .build ());
Original file line number Diff line number Diff line change 2020import io .helidon .config .Config ;
2121import io .helidon .config .ConfigSources ;
2222
23+ import io .helidon .service .registry .Services ;
24+ import io .helidon .testing .junit5 .Testing ;
2325import org .junit .jupiter .api .AfterAll ;
2426import org .junit .jupiter .api .BeforeAll ;
2527import org .testcontainers .containers .OracleContainer ;
3032
3133import static io .helidon .config .ConfigSources .classpath ;
3234
35+ @ Testing .Test
3336@ Testcontainers (disabledWithoutDocker = true )
3437public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {
3538
@@ -45,7 +48,7 @@ public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {
4548
4649 @ BeforeAll
4750 static void start () {
48- Config . global ( Config .builder ()
51+ Services . set ( Config . class , Config .builder ()
4952 .addSource (ConfigSources .create (Map .of ("db.connection.url" , container .getJdbcUrl ())))
5053 .addSource (classpath ("application-oracle-test.yaml" ))
5154 .build ());
Original file line number Diff line number Diff line change 2222import io .helidon .dbclient .DbClient ;
2323import io .helidon .dbclient .health .DbClientHealthCheck ;
2424import io .helidon .logging .common .LogConfig ;
25+ import io .helidon .service .registry .Services ;
2526import io .helidon .webserver .WebServer ;
2627import io .helidon .webserver .WebServerConfig ;
2728import io .helidon .webserver .http .HttpRouting ;
@@ -72,7 +73,7 @@ private static void startServer() {
7273
7374 // By default, this will pick up application.yaml from the classpath
7475 Config config = mongo ? Config .create (ConfigSources .classpath (MONGO_CFG )) : Config .create ();
75- Config . global ( config );
76+ Services . set ( Config . class , config );
7677
7778 WebServer server = setupServer (WebServer .builder ())
7879 .build ()
Original file line number Diff line number Diff line change 2020import io .helidon .config .Config ;
2121import io .helidon .config .ConfigSources ;
2222
23+ import io .helidon .service .registry .Services ;
24+ import io .helidon .testing .junit5 .Testing ;
2325import org .junit .jupiter .api .AfterAll ;
2426import org .junit .jupiter .api .BeforeAll ;
2527import org .testcontainers .containers .GenericContainer ;
3335/**
3436 * Tests {@link io.helidon.examples.dbclient.pokemons.PokemonService}.
3537 */
38+ @ Testing .Test
3639@ Testcontainers (disabledWithoutDocker = true )
3740class PokemonServiceH2IT extends AbstractPokemonServiceTest {
3841 private static final DockerImageName H2_IMAGE = DockerImageName .parse ("nemerosa/h2" );
@@ -45,7 +48,7 @@ class PokemonServiceH2IT extends AbstractPokemonServiceTest {
4548 @ BeforeAll
4649 static void start () {
4750 String url = String .format ("jdbc:h2:tcp://localhost:%s/~./test" , container .getMappedPort (9082 ));
48- Config . global ( Config .builder ()
51+ Services . set ( Config . class , Config .builder ()
4952 .addSource (ConfigSources .create (Map .of ("db.connection.url" , url )))
5053 .addSource (classpath ("application-h2-test.yaml" ))
5154 .build ());
Original file line number Diff line number Diff line change 2020import io .helidon .config .Config ;
2121import io .helidon .config .ConfigSources ;
2222
23+ import io .helidon .service .registry .Services ;
24+ import io .helidon .testing .junit5 .Testing ;
2325import org .junit .jupiter .api .AfterAll ;
2426import org .junit .jupiter .api .BeforeAll ;
2527import org .testcontainers .containers .MongoDBContainer ;
2830
2931import static io .helidon .config .ConfigSources .classpath ;
3032
33+ @ Testing .Test
3134@ Testcontainers (disabledWithoutDocker = true )
3235public class PokemonServiceMongoIT extends AbstractPokemonServiceTest {
3336
@@ -38,7 +41,7 @@ public class PokemonServiceMongoIT extends AbstractPokemonServiceTest {
3841 @ BeforeAll
3942 static void start () {
4043 String url = String .format ("mongodb://127.0.0.1:%s/pokemon" , container .getMappedPort (27017 ));
41- Config . global ( Config .builder ()
44+ Services . set ( Config . class , Config .builder ()
4245 .addSource (ConfigSources .create (Map .of ("db.connection.url" , url )))
4346 .addSource (classpath ("application-mongo-test.yaml" ))
4447 .build ());
Original file line number Diff line number Diff line change 2020import io .helidon .config .Config ;
2121import io .helidon .config .ConfigSources ;
2222
23+ import io .helidon .service .registry .Services ;
24+ import io .helidon .testing .junit5 .Testing ;
2325import org .junit .jupiter .api .AfterAll ;
2426import org .junit .jupiter .api .BeforeAll ;
2527import org .testcontainers .containers .MySQLContainer ;
2830
2931import static io .helidon .config .ConfigSources .classpath ;
3032
33+ @ Testing .Test
3134@ Testcontainers (disabledWithoutDocker = true )
3235public class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {
3336
@@ -40,7 +43,7 @@ public class PokemonServiceMySQLIT extends AbstractPokemonServiceTest {
4043
4144 @ BeforeAll
4245 static void start () {
43- Config . global ( Config .builder ()
46+ Services . set ( Config . class , Config .builder ()
4447 .addSource (ConfigSources .create (Map .of ("db.connection.url" , container .getJdbcUrl ())))
4548 .addSource (classpath ("application-mysql-test.yaml" ))
4649 .build ());
Original file line number Diff line number Diff line change 2020import io .helidon .config .Config ;
2121import io .helidon .config .ConfigSources ;
2222
23+ import io .helidon .service .registry .Services ;
24+ import io .helidon .testing .junit5 .Testing ;
2325import org .junit .jupiter .api .AfterAll ;
2426import org .junit .jupiter .api .BeforeAll ;
2527import org .testcontainers .containers .OracleContainer ;
3032
3133import static io .helidon .config .ConfigSources .classpath ;
3234
35+ @ Testing .Test
3336@ Testcontainers (disabledWithoutDocker = true )
3437public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {
3538
@@ -45,7 +48,7 @@ public class PokemonServiceOracleIT extends AbstractPokemonServiceTest {
4548
4649 @ BeforeAll
4750 static void setup () {
48- Config . global ( Config .builder ()
51+ Services . set ( Config . class , Config .builder ()
4952 .addSource (ConfigSources .create (Map .of ("db.connection.url" , container .getJdbcUrl ())))
5053 .addSource (classpath ("application-oracle-test.yaml" ))
5154 .build ());
You can’t perform that action at this time.
0 commit comments