Class RunResult<C extends io.dropwizard.core.Configuration>
java.lang.Object
ru.vyarus.dropwizard.guice.test.util.RunResult<C>
- Type Parameters:
C- configuration type
Application run result object for
TestSupport runs. It is important
to construct this object in time of running application because it would be impossible to reference these
objects after application shutdown.
Object supposed to be used for assertions after the application stopped.
- Since:
- 24.11.2023
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends io.dropwizard.core.Application<C>>
T<T> TgetBean(com.google.inject.Key<T> key) Access guice bean by mapping key (for qualified or generified bindings).<T> TAccess guice bean.io.dropwizard.core.setup.Environmentcom.google.inject.Injectorio.dropwizard.testing.DropwizardTestSupport<C>booleanisWebRun()
-
Constructor Details
-
RunResult
public RunResult(io.dropwizard.testing.DropwizardTestSupport<C> support, com.google.inject.Injector injector) Create result.- Parameters:
support- dropwizard test supportinjector- injector
-
-
Method Details
-
getSupport
- Returns:
- support object used for application run
-
getInjector
public com.google.inject.Injector getInjector()- Returns:
- injector, created during application run
-
getApplication
- Type Parameters:
T- application type- Returns:
- application instance (used for run)
-
getEnvironment
public io.dropwizard.core.setup.Environment getEnvironment()- Returns:
- environment instance (used for run)
-
getConfiguration
- Returns:
- configuration instance
-
getBean
Access guice bean.- Type Parameters:
T- target type- Parameters:
type- bean type- Returns:
- bean instance or null
-
getBean
public <T> T getBean(com.google.inject.Key<T> key) Access guice bean by mapping key (for qualified or generified bindings).- Type Parameters:
T- target type- Parameters:
key- bean key- Returns:
- bean instance
-
isWebRun
public boolean isWebRun()- Returns:
- true for full web app run, false for core run (guice injector only)
-