Skip to content

Commit

Permalink
Per bootique/bootique#344 BQModuleProvider is deprecated and unneeded
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Dec 5, 2023
1 parent 5000773 commit 9146659
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}

0 comments on commit 9146659

Please sign in to comment.