Annotation Type InstancioSource


@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) @Documented @ArgumentsSource(InstancioArgumentsProvider.class) public @interface InstancioSource
Provides arguments for @ParameterizedTest methods. Supports multiple arguments. Each argument will be a fully-populated instance.

Example:



 @ExtendWith(InstancioExtension.class)
 class ExampleTest {

     @ParameterizedTest
     @InstancioSource
     void someTestMethod(Person person) {
         // ... use supplied person
     }
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    Deprecated.
    parameter types will be resolved from method arguments, therefore specifying the types via the annotation is no longer necessary (this method will be removed in version 3.0.0).
  • Element Details

    • value

      @Deprecated Class<?>[] value
      Deprecated.
      parameter types will be resolved from method arguments, therefore specifying the types via the annotation is no longer necessary (this method will be removed in version 3.0.0).
      Specifies parameter types to generate. Each specified type represents a parameter in the ParameterizedTest method.
      Returns:
      parameter types to generate
      Default:
      {}