org.sdase.commons.server.weld.testing.WeldAppExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sda-commons-server-weld-testing Show documentation
Show all versions of sda-commons-server-weld-testing Show documentation
A libraries to bootstrap services easily that follow the patterns and specifications promoted by the SDA SE
The newest version!
package org.sdase.commons.server.weld.testing;
import io.dropwizard.core.Application;
import io.dropwizard.core.Configuration;
import io.dropwizard.testing.ConfigOverride;
import io.dropwizard.testing.junit5.DropwizardAppExtension;
import jakarta.annotation.Nullable;
/**
* An App Rule that uses WELD to inject the application class.
*
* Example usage:
*
*
* @RegisterExtension
* static final WeldAppExtension<AppConfiguration%gt APP =
* new WeldAppExtension<>(WeldExampleApplication.class, resourceFilePath("test-config.yaml"));
*
*/
public class WeldAppExtension extends DropwizardAppExtension {
public WeldAppExtension(
Class extends Application> applicationClass,
@Nullable String configPath,
ConfigOverride... configOverrides) {
super(new WeldTestSupport<>(applicationClass, configPath, configOverrides));
}
public WeldAppExtension(Class extends Application> applicationClass, C configuration) {
super(new WeldTestSupport<>(applicationClass, configuration));
}
}