Class StoredReusableApp

java.lang.Object
ru.vyarus.dropwizard.guice.test.util.StoredReusableApp
All Implemented Interfaces:
org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource

public class StoredReusableApp extends Object implements org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
Storage value for reusable application. Value would be created by the first test (using reusable app) and would be closed after all tests (automatically by junit).

Reusable app is identified in root storage by declaration class name because only one application extension could be used in single test.

Since:
19.12.2022
  • Constructor Details

    • StoredReusableApp

      public StoredReusableApp(Class<?> declaration, String source, io.dropwizard.testing.DropwizardTestSupport<?> support, ClientSupport client)
      Create stored app.
      Parameters:
      declaration - declaration test class
      source - declaration source description
      support - dropwizard test support
      client - client
  • Method Details

    • getDeclaration

      public Class<?> getDeclaration()
      Returns:
      base test class where extension was declared
    • getSource

      public String getSource()
      Returns:
      declaration source (base class + annotation or field name)
    • getSupport

      public io.dropwizard.testing.DropwizardTestSupport<?> getSupport()
      Returns:
      reusable support object
    • getClient

      public ClientSupport getClient()
      Returns:
      reusable client instance
    • close

      public void close() throws Exception
      Specified by:
      close in interface org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object