Class RunResult<C extends io.dropwizard.Configuration>

  • Type Parameters:
    C - configuration type

    public class RunResult<C extends io.dropwizard.Configuration>
    extends java.lang.Object
    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 
      Constructor Description
      RunResult​(io.dropwizard.testing.DropwizardTestSupport<C> support, com.google.inject.Injector injector)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.dropwizard.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.setup.Environment getEnvironment()  
      com.google.inject.Injector getInjector()  
      io.dropwizard.testing.DropwizardTestSupport<C> getSupport()  
      boolean isWebRun()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.Application<C> getApplication()
        Returns:
        application instance (used for run)
      • getEnvironment

        public io.dropwizard.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)