Class OutputCapture
- java.lang.Object
- org.springframework.boot.testsupport.rule.OutputCapture
- All Implemented Interfaces:
org.junit.rules.TestRule
public class OutputCapture extends Object implements org.junit.rules.TestRule
Internal JUnit@Rule
to capture output from System.out and System.err.
Constructor Summary
Constructors Constructor Description OutputCapture()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.junit.runners.model.Statement
apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
protected void
captureOutput()
void
expect(org.hamcrest.Matcher<? super String> matcher)
Verify that the output is matched by the suppliedmatcher
.void
flush()
protected void
releaseOutput()
String
toString()
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:
apply
in interfaceorg.junit.rules.TestRule
captureOutput
protected void captureOutput()
releaseOutput
protected void releaseOutput()
flush
public void flush()