Annotation Type UseGuiceyApp
-
@Retention(RUNTIME) @Target(TYPE) public @interface UseGuiceyAppGuicey spock extension. Starts guice context only (without web part).Managedobjects 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.Sharedmay be used to define common injection points for all tests in class.Note:
setupSpec()fixture is called after application start andcleanupSpec()before application tear down.Extension would also recognize the following test fields (including super classes):
- static
GuiceyConfigurationHookannotated withEnableHook- hook from field will be registered ClientSupportannotated withInjectClientfield 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.- Since:
- 02.01.2015
- See Also:
InjectClient
- static
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Class<? extends io.dropwizard.core.Application>value
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringconfigConfigOverride[]configOverridejava.lang.Class<? extends ru.vyarus.dropwizard.guice.hook.GuiceyConfigurationHook>[]hooksHooks provide access to guice builder allowing complete customization of application context in tests.
-
-
-
-
configOverride
ConfigOverride[] configOverride
- Returns:
- list of overridden configuration values (may be used even without real configuration)
- Default:
- {}
-
-
-
hooks
java.lang.Class<? extends ru.vyarus.dropwizard.guice.hook.GuiceyConfigurationHook>[] hooks
Hooks provide access to guice builder allowing complete customization of application context in tests.Additional hooks could be declared in static test fields:
@EnableHook static GuiceyConfigurationHook HOOK = { it.disableExtensions(Something.class)}.- Returns:
- list of hooks to use
- See Also:
for more info,EnableHook
- Default:
- {}
-
-