Class OutputCapture
- java.lang.Object
- org.springframework.boot.test.rule.OutputCapture
- All Implemented Interfaces:
org.junit.rules.TestRule
public class OutputCapture extends Object implements org.junit.rules.TestRule
JUnit@Ruleto capture output from System.out and System.err.- Since:
- 1.4.0
Constructor Summary
Constructors Constructor Description OutputCapture()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description)protected voidcaptureOutput()voidexpect(org.hamcrest.Matcher<? super String> matcher)Verify that the output is matched by the suppliedmatcher.voidflush()protected voidreleaseOutput()voidreset()Discard all currently accumulated output.StringtoString()
Constructor Detail
OutputCapture
public OutputCapture()
Method Detail
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
- Specified by:
applyin interfaceorg.junit.rules.TestRule
captureOutput
protected void captureOutput()
releaseOutput
protected void releaseOutput()
reset
public void reset()
Discard all currently accumulated output.
flush
public void flush()