CapturedOutput
Provides access to System.out and System.err output that has been captured by the OutputCaptureExtension or OutputCaptureRule. Can be used to apply assertions either using AssertJ or standard JUnit assertions. For example:
assertThat(output).contains("started"); // Checks all output
assertThat(output.getErr()).contains("failed"); // Only checks System.err
assertThat(output.getOut()).contains("ok"); // Only checks System.out
Content copied to clipboard
Author
Madhura Bhave
Phillip Webb
Andy Wilkinson
Since
2.2.0
See also
Inheritors
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Return all content (both System.out and System.err) in the order that it was captured.
Link copied to clipboard
Return System.err content in the order that it was captured.
Link copied to clipboard
Return System.out content in the order that it was captured.
Link copied to clipboard