Annotation Type StdIo


  • @Retention(RUNTIME)
    @Target({METHOD,ANNOTATION_TYPE})
    @ExtendWith(StdIoExtension.class)
    public @interface StdIo
    Allows specifying the input that's read from System.in as well as capturing lines read from System.in (with parameter StdIn) or written to System.out (with parameter StdOut).

    The annotated test method can have zero, one, or both parameters, but StdIn can only be provided if value() is used to specify input - otherwise an ExtensionConfigurationException will be thrown.

    During parallel test execution, all tests annotated with StdIo, ReadsStdIo, and WritesStdIo are scheduled in a way that guarantees correctness under mutation of shared global state.

    For more details and examples, see the documentation on standard input/output.

    Since:
    0.7
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] value
      Provides the intercepted standard input with values.
    • Element Detail

      • value

        java.lang.String[] value
        Provides the intercepted standard input with values. If this is not blank, the annotated method can have a StdIn parameter.
        Default:
        {}