Class RunResult<C extends io.dropwizard.core.Configuration>
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.test.util.RunResult<C>
-
- Type Parameters:
C- configuration type
public class RunResult<C extends io.dropwizard.core.Configuration> extends java.lang.ObjectApplication run result object forTestSupportruns. 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends io.dropwizard.core.Application<C>>
TgetApplication()<T> TgetBean(com.google.inject.Key<T> key)Access guice bean by mapping key (for qualified or generified bindings).<T> TgetBean(java.lang.Class<T> type)Access guice bean.CgetConfiguration()io.dropwizard.core.setup.EnvironmentgetEnvironment()com.google.inject.InjectorgetInjector()io.dropwizard.testing.DropwizardTestSupport<C>getSupport()booleanisWebRun()
-
-
-
Constructor Detail
-
RunResult
public RunResult(io.dropwizard.testing.DropwizardTestSupport<C> support, com.google.inject.Injector injector)
Create result.- Parameters:
support- dropwizard test supportinjector- injector
-
-
Method Detail
-
getSupport
public io.dropwizard.testing.DropwizardTestSupport<C> getSupport()
- Returns:
- support object used for application run
-
getInjector
public com.google.inject.Injector getInjector()
- Returns:
- injector, created during application run
-
getApplication
public <T extends io.dropwizard.core.Application<C>> T 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
public C getConfiguration()
- Returns:
- configuration instance
-
getBean
public <T> T getBean(java.lang.Class<T> type)
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)
-
-