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 ea90722 commit d244511
Show file tree
Hide file tree
Showing 51 changed files with 133 additions and 394 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package io.bootique.jersey.beanvalidation;

import io.bootique.ConfigModule;
import io.bootique.ModuleCrate;
import io.bootique.di.Binder;

/**
Expand All @@ -32,6 +33,13 @@ public static JerseyBeanValidationModuleExtender extend(Binder binder) {
return new JerseyBeanValidationModuleExtender(binder);
}

@Override
public ModuleCrate crate() {
return ModuleCrate.of(this)
.description("Deprecated, can be replaced with 'bootique-jersey-jakarta-beanvalidation'.")
.build();
}

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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
*/
package io.bootique.jersey.beanvalidation;

import io.bootique.junit5.BQModuleProviderChecker;
import io.bootique.junit5.BQModuleTester;
import org.junit.jupiter.api.Test;

public class JerseyBeanValidationModuleProviderTest {
public class JerseyBeanValidationModuleTest {

@Test
public void autoLoadable() {
BQModuleProviderChecker.testAutoLoadable(JerseyBeanValidationModuleProvider.class);
BQModuleTester.of(JerseyBeanValidationModule.class).testAutoLoadable().testConfig();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.codahale.metrics.MetricRegistry;
import io.bootique.ConfigModule;
import io.bootique.ModuleCrate;
import io.bootique.config.ConfigurationFactory;
import io.bootique.di.Binder;
import io.bootique.di.Provides;
Expand All @@ -39,6 +40,14 @@ public class JerseyClientInstrumentedModule extends ConfigModule {

public static final MetricNaming METRIC_NAMING = MetricNaming.forModule(JerseyClientInstrumentedModule.class);

@Override
public ModuleCrate crate() {
return ModuleCrate.of(this)
.description("Deprecated, can be replaced with 'bootique-jersey-jakarta-client-instrumented'.")
.overrides(JerseyClientModule.class)
.build();
}

@Override
protected String defaultConfigPrefix() {
// reusing overridden module prefix
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
import io.bootique.Bootique;
import io.bootique.jersey.JerseyModule;
import io.bootique.jersey.client.HttpClientFactory;
import io.bootique.jersey.client.JerseyClientModuleProvider;
import io.bootique.jersey.client.JerseyClientModule;
import io.bootique.jetty.junit5.JettyTester;
import io.bootique.junit5.BQApp;
import io.bootique.junit5.BQTest;
import io.bootique.junit5.BQTestFactory;
import io.bootique.junit5.BQTestTool;
import io.bootique.metrics.MetricsModule;
import io.bootique.metrics.health.HealthCheckModule;
import io.bootique.metrics.health.HealthCheckOutcome;
import io.bootique.metrics.health.HealthCheckRegistry;
import io.bootique.metrics.health.HealthCheckStatus;
Expand Down Expand Up @@ -60,8 +62,7 @@ public class InstrumentedClient_ThresholdsIT {

private BQRuntime createClient() {
return clientFactory.app()
.moduleProvider(new JerseyClientModuleProvider())
.moduleProvider(new JerseyClientInstrumentedModuleProvider())
.modules(JerseyClientModule.class, JerseyClientInstrumentedModule.class, HealthCheckModule.class, MetricsModule.class)
.property("bq.jerseyclient.health.requestsPerMin.warning", "0.3")
.property("bq.jerseyclient.health.requestsPerMin.critical", "0.6")
.createRuntime();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,22 @@
* under the License.
*/

package io.bootique.jersey;
package io.bootique.jersey.client.instrumented;

import io.bootique.BQRuntime;
import io.bootique.jetty.JettyModule;
import io.bootique.junit5.*;
import io.bootique.junit5.BQModuleTester;
import io.bootique.junit5.BQTest;
import io.bootique.junit5.BQTestFactory;
import io.bootique.junit5.BQTestTool;
import org.junit.jupiter.api.Test;

@BQTest
public class JerseyModuleProviderIT {
public class JerseyClientInstrumentedModuleTest {

@BQTestTool
final BQTestFactory testFactory = new BQTestFactory();

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

@Test
public void moduleDeclaresDependencies() {
BQRuntime bqRuntime = testFactory.app().moduleProvider(new JerseyModuleProvider()).createRuntime();
BQRuntimeChecker.testModulesLoaded(bqRuntime,
JettyModule.class,
JerseyModule.class
);
BQModuleTester.of(JerseyClientInstrumentedModule.class).testAutoLoadable().testConfig();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package io.bootique.jersey.client;

import io.bootique.ConfigModule;
import io.bootique.ModuleCrate;
import io.bootique.config.ConfigurationFactory;
import io.bootique.di.Binder;
import io.bootique.di.Injector;
Expand All @@ -46,6 +47,14 @@ public static JerseyClientModuleExtender extend(Binder binder) {
return new JerseyClientModuleExtender(binder);
}

@Override
public ModuleCrate crate() {
return ModuleCrate.of(new JerseyClientModule())
.description("Deprecated, can be replaced with 'bootique-jersey-jakarta-client'.")
.config("jerseyclient", HttpClientFactoryFactory.class)
.build();
}

@Override
public void configure(Binder binder) {
extend(binder).initAllExtensions();
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public class HttpClientFactoryIT {

@BQApp
static final BQRuntime server = Bootique.app("--server")
.modules(JettyModule.class, JerseyModule.class)
.moduleProvider(new LogbackModule())
.modules(JettyModule.class, JerseyModule.class, LogbackModule.class)
.module(b -> JerseyModule.extend(b).addResource(Resource.class))
.module(jetty.moduleReplacingConnectors())
.createRuntime();
Expand All @@ -61,8 +60,7 @@ public class HttpClientFactoryIT {
public void newClient() {
HttpClientFactory factory =
clientFactory.app()
.moduleProvider(new JerseyClientModuleProvider())
.moduleProvider(new LogbackModule())
.modules(JerseyClientModule.class, LogbackModule.class)
.createRuntime()
.getInstance(HttpClientFactory.class);

Expand All @@ -77,8 +75,7 @@ public void newClient() {
public void newClientAuth() {
HttpClientFactory factory =
clientFactory.app()
.moduleProvider(new JerseyClientModuleProvider())
.moduleProvider(new LogbackModule())
.modules(JerseyClientModule.class, LogbackModule.class)
.property("bq.jerseyclient.auth.auth1.type", "basic")
.property("bq.jerseyclient.auth.auth1.username", "u")
.property("bq.jerseyclient.auth.auth1.password", "p")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public class HttpClientFactory_TrustStoresIT {
@BQApp
static final BQRuntime server = Bootique
.app("-s", "-c", "classpath:io/bootique/jersey/client/TrustStoresIT_server.yml")
.modules(JettyModule.class, JerseyModule.class)
.moduleProvider(new LogbackModule())
.modules(JettyModule.class, JerseyModule.class, LogbackModule.class)
.module(b -> JerseyModule.extend(b).addResource(Resource.class))
.createRuntime();

Expand All @@ -63,8 +62,7 @@ public void namedTrustStore() {

HttpClientFactory factory = clientFactory
.app("-c", "classpath:io/bootique/jersey/client/TrustStoresIT_client.yml")
.moduleProvider(new JerseyClientModuleProvider())
.moduleProvider(new LogbackModule())
.modules(JerseyClientModule.class, LogbackModule.class)
.createRuntime()
.getInstance(HttpClientFactory.class);

Expand Down Expand Up @@ -93,8 +91,7 @@ public void namedTrustStore_Invalid() {

HttpClientFactory factory = clientFactory
.app("-c", "classpath:io/bootique/jersey/client/TrustStoresIT_client.yml")
.moduleProvider(new JerseyClientModuleProvider())
.moduleProvider(new LogbackModule())
.modules(JerseyClientModule.class, LogbackModule.class)
.createRuntime()
.getInstance(HttpClientFactory.class);

Expand Down
Loading

0 comments on commit d244511

Please sign in to comment.