public static class TestDropwizardAppExtension.Builder
extends java.lang.Object
TestDropwizardAppExtension.forApp(Class)).| Constructor and Description |
|---|
Builder(java.lang.Class<? extends io.dropwizard.Application> app) |
| Modifier and Type | Method and Description |
|---|---|
TestDropwizardAppExtension.Builder |
config(java.lang.String configPath)
Same as
TestDropwizardApp.config(). |
TestDropwizardAppExtension.Builder |
configOverrides(java.lang.String... values)
Same as
TestDropwizardApp.configOverride(). |
TestDropwizardAppExtension |
create()
Creates extension.
|
TestDropwizardAppExtension.Builder |
hooks(java.lang.Class<? extends GuiceyConfigurationHook> hooks)
Same as
TestDropwizardApp.hooks(). |
TestDropwizardAppExtension.Builder |
hooks(GuiceyConfigurationHook... hooks)
Has no annotation equivalent.
|
TestDropwizardAppExtension.Builder |
randomPorts()
Shortcut for
randomPorts(boolean). |
TestDropwizardAppExtension.Builder |
randomPorts(boolean randomPorts)
Same as
TestDropwizardApp.randomPorts(). |
TestDropwizardAppExtension.Builder |
restMapping(java.lang.String mapping)
Same as
TestDropwizardApp.restMapping(). |
public TestDropwizardAppExtension.Builder config(java.lang.String configPath)
TestDropwizardApp.config().configPath - configuration file pathpublic TestDropwizardAppExtension.Builder configOverrides(java.lang.String... values)
TestDropwizardApp.configOverride(). Multiple calls will not be merged!values - overriding configuration values in "key: value" formatpublic TestDropwizardAppExtension.Builder hooks(java.lang.Class<? extends GuiceyConfigurationHook> hooks)
TestDropwizardApp.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 TestDropwizardAppExtension.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 TestDropwizardAppExtension.Builder randomPorts(boolean randomPorts)
TestDropwizardApp.randomPorts().randomPorts - true to use random portspublic TestDropwizardAppExtension.Builder randomPorts()
randomPorts(boolean).public TestDropwizardAppExtension.Builder restMapping(java.lang.String mapping)
TestDropwizardApp.restMapping().mapping - rest mapping pathpublic TestDropwizardAppExtension 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.