Annotation Type New


@ExtendWith(ResourceExtension.class) @Retention(RUNTIME) @Target({PARAMETER,ANNOTATION_TYPE}) public @interface New
@New is used to create a new resource.

It is part of the "resources" JUnit Jupiter extension, which pertains to anything that needs to be injected into tests and which may need to be started up or torn down. Temporary directories are a common example.

This class is intended for users.

For more details and examples, see the documentation on resources and temporary directories.

Since:
1.9.0
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<? extends ResourceFactory<?>>
    The class of the resource factory to get the resource from.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    An array of string arguments to pass to the resource factory.
  • Element Details

    • value

      Class<? extends ResourceFactory<?>> value
      The class of the resource factory to get the resource from.
    • arguments

      String[] arguments
      An array of string arguments to pass to the resource factory.

      Refer to the documentation of the resource factory implementation that is passed to this annotation for more information on which arguments are accepted and what they do.

      Default:
      {}