public static class TestGuiceyAppExtension.Builder
extends java.lang.Object
TestGuiceyAppExtension.forApp(Class)).| Constructor and Description |
|---|
Builder(java.lang.Class<? extends io.dropwizard.Application> app) |
| Modifier and Type | Method and Description |
|---|---|
TestGuiceyAppExtension.Builder |
config(java.lang.String configPath)
Same as
TestGuiceyApp.config(). |
TestGuiceyAppExtension.Builder |
configOverrides(java.lang.String... values)
Same as
TestGuiceyApp.configOverride(). |
TestGuiceyAppExtension |
create()
Creates extension.
|
TestGuiceyAppExtension.Builder |
hooks(java.lang.Class<? extends GuiceyConfigurationHook> hooks)
Same as
TestGuiceyApp.hooks(). |
TestGuiceyAppExtension.Builder |
hooks(GuiceyConfigurationHook... hooks)
Has no annotation equivalent.
|
public TestGuiceyAppExtension.Builder config(java.lang.String configPath)
TestGuiceyApp.config().configPath - configuration file pathpublic TestGuiceyAppExtension.Builder configOverrides(java.lang.String... values)
TestGuiceyApp.configOverride(). Multiple calls will not be merged!values - overriding configuration values in "key: value" formatpublic TestGuiceyAppExtension.Builder hooks(java.lang.Class<? extends GuiceyConfigurationHook> hooks)
TestGuiceyApp.hooks(). May be called multiple times.
Anonymous hooks could be declared with a static field:
@EnableHook static GuiceyConfigurationHook hook = builder -> builder.disableExtension(
Something.class).
All such fields will be detected automatically and hooks registered. Hooks declared in base test classes
are also counted.
hooks - hook classes to usepublic TestGuiceyAppExtension.Builder hooks(GuiceyConfigurationHook... hooks)
.hooks(builder -> builder.modules(new DebugModule()))
May be called multiple times.
Also, anonymous hooks could be declared with a static field:
@EnableHook static GuiceyConfigurationHook hook = builder -> builder.disableExtension(
Something.class).
All such fields will be detected automatically and hooks registered. Hooks declared in base test classes
are also counted.
hooks - hook instances (may be lambdas)public TestGuiceyAppExtension create()
Note that extension must be assigned to static field! Extension instance does not provide additional methods so use field and parameter injections as with annotation extension declaration.