Annotation Type InstancioSource


@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) @Documented @ArgumentsSource(org.instancio.junit.internal.InstancioSourceArgumentsProvider.class) public @interface InstancioSource
Provides arguments for @ParameterizedTest methods, supporting multiple arguments per test run. Each argument will be a fully-populated instance generated by Instancio.

Example usage:


 @ExtendWith(InstancioExtension.class)
 class ExampleTest {
     @ParameterizedTest
     @InstancioSource(samples = 3)
     void someTestMethod(String s, int n, Person person) {
         // ... use generated arguments
     }
 }
 

The above example will run the test method 3 times, each time with a different set of arguments: a random string, a random integer, and a randomly populated instance of the Person class.

Since:
1.1.8