Class MicronautTestValue

java.lang.Object
io.micronaut.test.annotation.MicronautTestValue

@Internal public class MicronautTestValue extends Object
Value object for the values from any of the MicronautTest annotations.
Since:
2.1.0
Author:
Álvaro Sánchez-Mariscal
  • Constructor Details

    • MicronautTestValue

      @Creator public MicronautTestValue(Class<?> application, String[] environments, String[] packages, String[] propertySources, boolean rollback, boolean transactional, boolean rebuildContext, Class<? extends io.micronaut.context.ApplicationContextBuilder>[] contextBuilder, TransactionMode transactionMode, boolean startApplication, boolean resolveParameters)
      Default constructor.
      Parameters:
      application - The application class of the application
      environments - The environments to use.
      packages - The packages to consider for scanning.
      propertySources - The property sources
      rollback - True if changes should be rolled back
      transactional - Whether to wrap a test in a transaction.
      rebuildContext - true if the application context should be rebuilt for each test method
      contextBuilder - The builder
      transactionMode - The transaction mode
      startApplication - Whether the start the app
      resolveParameters - Whether to resolve parameters to beans
  • Method Details

    • application

      public Class<?> application()
      Returns:
      The application class of the application
    • environments

      public String[] environments()
      Returns:
      The environments to use.
    • packages

      public String[] packages()
      Returns:
      The packages to consider for scanning.
    • propertySources

      public String[] propertySources()
      One or many references to classpath. For example: "classpath:mytest.yml"
      Returns:
      The property sources
    • rollback

      public boolean rollback()
      Whether to rollback (if possible) any data access code between each test execution.
      Returns:
      True if changes should be rolled back
    • transactional

      public boolean transactional()
      Allow disabling or enabling of automatic transaction wrapping.
      Returns:
      Whether to wrap a test in a transaction.
    • rebuildContext

      public boolean rebuildContext()
      Whether to rebuild the application context before each test method.
      Returns:
      true if the application context should be rebuilt for each test method
    • contextBuilder

      public Class<? extends io.micronaut.context.ApplicationContextBuilder>[] contextBuilder()
      The application context builder to use to construct the context.
      Returns:
      The builder
    • transactionMode

      public TransactionMode transactionMode()
      Returns:
      The transaction mode
    • startApplication

      public boolean startApplication()
      Returns:
      Whether to start the embedded application
    • isResolveParameters

      public boolean isResolveParameters()
      Returns:
      Whether to resolve test method parameters.