Annotation Interface QuarkusTestResource


@Target(TYPE) @Retention(RUNTIME) @Documented @Repeatable(List.class) public @interface QuarkusTestResource
Used to define a test resource.

All QuarkusTestResource annotations in the test module are discovered (regardless of the test which contains the annotation) and their corresponding QuarkusTestResourceLifecycleManager started before any test is run.

Note that test resources are never restarted when running @Nested test classes.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
     
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
    boolean
    Whether this test resource is to be started in parallel (concurrently) along with others also marked as parallel
    boolean
    Whether this annotation should only be enabled if it is placed on the currently running test class or test profile.
  • Element Details

    • initArgs

      ResourceArg[] initArgs
      Returns:
      The arguments to be passed to the QuarkusTestResourceLifecycleManager
      See Also:
      Default:
      {}
    • parallel

      boolean parallel
      Whether this test resource is to be started in parallel (concurrently) along with others also marked as parallel
      Default:
      false
    • restrictToAnnotatedClass

      boolean restrictToAnnotatedClass
      Whether this annotation should only be enabled if it is placed on the currently running test class or test profile. Note that this defaults to true for meta-annotations since meta-annotations are only considered for the current test class or test profile.

      Note: When this is set to true, the annotation @QuarkusTestResource will result in the application being re-augmented and restarted (in a similar fashion as happens in dev mode when a change is detected).

      Default:
      false