@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface UseGuiceyApp
Managed
objects will be still executed correctly. Guice injectior is created before all tests in class and shut down
after them.
Gucie injections will work on test class (just annotate required fields with Inject.
Shared may be used to define common injection points for all tests in class.
Note: setupSpec() fixture is called after application start and cleanupSpec() before
application tear down.
Extension would also recognize the following test fields (including super classes):
GuiceyConfigurationHook annotated with EnableHook - hook
from field will be registeredClientSupport annotated with InjectClient field will be injected
with client instance. Note that only generic client may be used (to call 3rd party external services), as
application's web part is not started.
Internally based on DropwizardTestSupport.
InjectClient| Modifier and Type | Required Element and Description |
|---|---|
java.lang.Class<? extends io.dropwizard.Application> |
value |
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String |
config |
ConfigOverride[] |
configOverride |
java.lang.Class<? extends GuiceyConfigurationHook>[] |
hooks
Hooks provide access to guice builder allowing complete customization of application context
in tests.
|
public abstract java.lang.Class<? extends io.dropwizard.Application> value
public abstract java.lang.String config
public abstract ConfigOverride[] configOverride
public abstract java.lang.Class<? extends GuiceyConfigurationHook>[] hooks
Additional hooks could be declared in static test fields:
@EnableHook static GuiceyConfigurationHook HOOK = { it.disableExtensions(Something.class)}.
for more info,
EnableHook