Interface CapturedOutput

All Superinterfaces:
CharSequence
All Known Implementing Classes:
OutputCaptureRule

public interface CapturedOutput extends CharSequence
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
 
Since:
2.2.0
Author:
Madhura Bhave, Phillip Webb, Andy Wilkinson
See Also: