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.Object
Application run result object forTestSupport
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.dropwizard.core.Application<C>
getApplication()
<T> T
getBean(com.google.inject.Key<T> key)
Access guice bean by mapping key (for qualified or generified bindings).<T> T
getBean(java.lang.Class<T> type)
Access guice bean.C
getConfiguration()
io.dropwizard.core.setup.Environment
getEnvironment()
com.google.inject.Injector
getInjector()
io.dropwizard.testing.DropwizardTestSupport<C>
getSupport()
boolean
isWebRun()
-
-
-
Constructor Detail
-
RunResult
public RunResult(io.dropwizard.testing.DropwizardTestSupport<C> support, com.google.inject.Injector 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 io.dropwizard.core.Application<C> getApplication()
- 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)
-
-