Class WeldTestSupport<C extends io.dropwizard.Configuration>


  • public class WeldTestSupport<C extends io.dropwizard.Configuration>
    extends io.dropwizard.testing.DropwizardTestSupport<C>
    Test support extension that uses WELD to inject the application class.

    Example usage:

       @RegisterExtension
       static final DropwizardAppExtension<AppConfiguration> EXTENSION = new DropwizardAppExtension<>(
           new WeldTestSupport<>(Application.class, ResourceHelpers.resourceFilePath("config.yml")));
     
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.dropwizard.testing.DropwizardTestSupport

        io.dropwizard.testing.DropwizardTestSupport.ServiceListener<T extends io.dropwizard.Configuration>
    • Field Summary

      • Fields inherited from class io.dropwizard.testing.DropwizardTestSupport

        application, applicationClass, commandInstantiator, configOverrides, configPath, configSourceProvider, configuration, customPropertyPrefix, environment, explicitConfig, jettyServer, listeners
    • Constructor Summary

      Constructors 
      Constructor Description
      WeldTestSupport​(java.lang.Class<? extends io.dropwizard.Application<C>> applicationClass, C configuration)  
      WeldTestSupport​(java.lang.Class<? extends io.dropwizard.Application<C>> applicationClass, java.lang.String configPath, io.dropwizard.testing.ConfigOverride... configOverrides)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void after()  
      io.dropwizard.Application<C> newApplication()  
      • Methods inherited from class io.dropwizard.testing.DropwizardTestSupport

        addListener, before, getAdminPort, getApplication, getConfiguration, getEnvironment, getLocalPort, getObjectMapper, getPort, manage
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WeldTestSupport

        public WeldTestSupport​(java.lang.Class<? extends io.dropwizard.Application<C>> applicationClass,
                               @Nullable
                               java.lang.String configPath,
                               io.dropwizard.testing.ConfigOverride... configOverrides)
      • WeldTestSupport

        public WeldTestSupport​(java.lang.Class<? extends io.dropwizard.Application<C>> applicationClass,
                               C configuration)
    • Method Detail

      • newApplication

        public io.dropwizard.Application<C> newApplication()
        Overrides:
        newApplication in class io.dropwizard.testing.DropwizardTestSupport<C extends io.dropwizard.Configuration>
      • after

        public void after()
        Overrides:
        after in class io.dropwizard.testing.DropwizardTestSupport<C extends io.dropwizard.Configuration>