From 9146659c282e9a8333b98a59acd4d49fd271a7f5 Mon Sep 17 00:00:00 2001 From: Andrus Adamchik Date: Tue, 5 Dec 2023 09:41:23 -0500 Subject: [PATCH] Per bootique/bootique#344 BQModuleProvider is deprecated and unneeded --- .../io/bootique/simplejavamail/SimpleJavaMailModule.java | 9 ++++----- ...io.bootique.BQModuleProvider => io.bootique.BQModule} | 0 .../simplejavamail/SimpleJavaMailModuleTest.java | 6 +++--- .../io/bootique/simplejavamail/SimpleJavaMailModule.java | 6 ++---- ...io.bootique.BQModuleProvider => io.bootique.BQModule} | 0 .../simplejavamail/SimpleJavaMailModuleTest.java | 6 +++--- 6 files changed, 12 insertions(+), 15 deletions(-) rename bootique-simplejavamail-jakarta/src/main/resources/META-INF/services/{io.bootique.BQModuleProvider => io.bootique.BQModule} (100%) rename bootique-simplejavamail/src/main/resources/META-INF/services/{io.bootique.BQModuleProvider => io.bootique.BQModule} (100%) diff --git a/bootique-simplejavamail-jakarta/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java b/bootique-simplejavamail-jakarta/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java index f44f644..5b3eb06 100644 --- a/bootique-simplejavamail-jakarta/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java +++ b/bootique-simplejavamail-jakarta/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java @@ -1,9 +1,8 @@ package io.bootique.simplejavamail; -import io.bootique.BQModuleProvider; import io.bootique.ModuleCrate; import io.bootique.config.ConfigurationFactory; -import io.bootique.di.BQModule; +import io.bootique.BQModule; import io.bootique.di.Binder; import io.bootique.di.Provides; import io.bootique.shutdown.ShutdownManager; @@ -13,13 +12,13 @@ /** * @since 2.0 */ -public class SimpleJavaMailModule implements BQModule, BQModuleProvider { +public class SimpleJavaMailModule implements BQModule { private static final String CONFIG_PREFIX = "simplejavamail"; @Override - public ModuleCrate moduleCrate() { - return ModuleCrate.of(this).provider(this).config(CONFIG_PREFIX, MailersFactory.class).build(); + public ModuleCrate crate() { + return ModuleCrate.of(this).config(CONFIG_PREFIX, MailersFactory.class).build(); } @Override diff --git a/bootique-simplejavamail-jakarta/src/main/resources/META-INF/services/io.bootique.BQModuleProvider b/bootique-simplejavamail-jakarta/src/main/resources/META-INF/services/io.bootique.BQModule similarity index 100% rename from bootique-simplejavamail-jakarta/src/main/resources/META-INF/services/io.bootique.BQModuleProvider rename to bootique-simplejavamail-jakarta/src/main/resources/META-INF/services/io.bootique.BQModule diff --git a/bootique-simplejavamail-jakarta/src/test/java/io/bootique/simplejavamail/SimpleJavaMailModuleTest.java b/bootique-simplejavamail-jakarta/src/test/java/io/bootique/simplejavamail/SimpleJavaMailModuleTest.java index 35335dc..28e17c5 100644 --- a/bootique-simplejavamail-jakarta/src/test/java/io/bootique/simplejavamail/SimpleJavaMailModuleTest.java +++ b/bootique-simplejavamail-jakarta/src/test/java/io/bootique/simplejavamail/SimpleJavaMailModuleTest.java @@ -1,12 +1,12 @@ package io.bootique.simplejavamail; -import io.bootique.junit5.BQModuleProviderChecker; +import io.bootique.junit5.BQModuleTester; import org.junit.jupiter.api.Test; public class SimpleJavaMailModuleTest { @Test - public void autoLoading() { - BQModuleProviderChecker.testAutoLoadable(SimpleJavaMailModule.class); + public void check() { + BQModuleTester.of(SimpleJavaMailModule.class).testAutoLoadable().testConfig(); } } diff --git a/bootique-simplejavamail/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java b/bootique-simplejavamail/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java index 6dd4a74..59529c6 100644 --- a/bootique-simplejavamail/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java +++ b/bootique-simplejavamail/src/main/java/io/bootique/simplejavamail/SimpleJavaMailModule.java @@ -1,6 +1,5 @@ package io.bootique.simplejavamail; -import io.bootique.BQModuleProvider; import io.bootique.ConfigModule; import io.bootique.ModuleCrate; import io.bootique.config.ConfigurationFactory; @@ -14,12 +13,11 @@ * @deprecated in favor of the Jakarta flavor */ @Deprecated(since = "3.0", forRemoval = true) -public class SimpleJavaMailModule extends ConfigModule implements BQModuleProvider { +public class SimpleJavaMailModule extends ConfigModule { @Override - public ModuleCrate moduleCrate() { + public ModuleCrate crate() { return ModuleCrate.of(this) - .provider(this) .description("Deprecated, can be replaced with 'bootique-simplejavamail-jakarta'.") .config(configPrefix, MailersFactory.class) .build(); diff --git a/bootique-simplejavamail/src/main/resources/META-INF/services/io.bootique.BQModuleProvider b/bootique-simplejavamail/src/main/resources/META-INF/services/io.bootique.BQModule similarity index 100% rename from bootique-simplejavamail/src/main/resources/META-INF/services/io.bootique.BQModuleProvider rename to bootique-simplejavamail/src/main/resources/META-INF/services/io.bootique.BQModule diff --git a/bootique-simplejavamail/src/test/java/io/bootique/simplejavamail/SimpleJavaMailModuleTest.java b/bootique-simplejavamail/src/test/java/io/bootique/simplejavamail/SimpleJavaMailModuleTest.java index 35335dc..28e17c5 100644 --- a/bootique-simplejavamail/src/test/java/io/bootique/simplejavamail/SimpleJavaMailModuleTest.java +++ b/bootique-simplejavamail/src/test/java/io/bootique/simplejavamail/SimpleJavaMailModuleTest.java @@ -1,12 +1,12 @@ package io.bootique.simplejavamail; -import io.bootique.junit5.BQModuleProviderChecker; +import io.bootique.junit5.BQModuleTester; import org.junit.jupiter.api.Test; public class SimpleJavaMailModuleTest { @Test - public void autoLoading() { - BQModuleProviderChecker.testAutoLoadable(SimpleJavaMailModule.class); + public void check() { + BQModuleTester.of(SimpleJavaMailModule.class).testAutoLoadable().testConfig(); } }