Skip to content

Commit

Permalink
"BuiltModule" got renamed to "ModuleCrate"
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Nov 26, 2023
1 parent ab97827 commit a22c126
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,33 @@

package io.bootique.logback.sentry;

import io.bootique.BQModuleProvider;
import io.bootique.ModuleCrate;
import io.bootique.di.Binder;
import io.bootique.di.BQModule;
import io.bootique.logback.LogbackModule;

import java.util.Collection;
import java.util.Collections;

/**
* Loads configuration for {@link io.sentry.Sentry}.
*/
public class LogbackSentryModule implements BQModule {
public class LogbackSentryModule implements BQModule, BQModuleProvider {

@Override
public ModuleCrate moduleCrate() {
return ModuleCrate.of(new LogbackSentryModule())
.provider(this)
.description("Integrates Sentry logging appender to Logback")
.build();
}

@Override
@Deprecated(since = "3.0", forRemoval = true)
public Collection<BQModuleProvider> dependencies() {
return Collections.singletonList(new LogbackModule());
}

@Override
public void configure(Binder binder) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
io.bootique.logback.sentry.LogbackSentryModuleProvider
io.bootique.logback.sentry.LogbackSentryModule
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@
import org.junit.jupiter.api.Test;

@BQTest
public class LogbackSentryModuleProviderIT {
public class LogbackSentryModuleTest {

@BQTestTool
final BQTestFactory testFactory = new BQTestFactory();

@Test
public void autoLoadable() {
BQModuleProviderChecker.testAutoLoadable(LogbackSentryModuleProvider.class);
BQModuleProviderChecker.testAutoLoadable(LogbackSentryModule.class);
}

@Test
public void metadata() {
BQModuleProviderChecker.testMetadata(LogbackSentryModuleProvider.class);
BQModuleProviderChecker.testMetadata(LogbackSentryModule.class);
}

@Test
public void moduleDeclaresDependencies() {
final BQRuntime bqRuntime = testFactory.app().moduleProvider(new LogbackSentryModuleProvider()).createRuntime();
final BQRuntime bqRuntime = testFactory.app().moduleProvider(new LogbackSentryModule()).createRuntime();
BQRuntimeChecker.testModulesLoaded(bqRuntime, LogbackSentryModule.class, LogbackModule.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import ch.qos.logback.classic.Logger;
import io.bootique.BQModuleProvider;
import io.bootique.annotation.LogLevels;
import io.bootique.bootstrap.BuiltModule;
import io.bootique.ModuleCrate;
import io.bootique.config.ConfigurationFactory;
import io.bootique.di.BQModule;
import io.bootique.di.Binder;
Expand All @@ -38,8 +38,8 @@ public class LogbackModule implements BQModule, BQModuleProvider {
private static final String CONFIG_PREFIX = "log";

@Override
public BuiltModule buildModule() {
return BuiltModule.of(this)
public ModuleCrate moduleCrate() {
return ModuleCrate.of(this)
.description("Integrates Logback logging library")
.config(CONFIG_PREFIX, LogbackContextFactory.class)
.build();
Expand Down

0 comments on commit a22c126

Please sign in to comment.