public class OutputCaptureRule extends Object implements org.junit.rules.TestRule
@Rule
to capture output from System.out and System.err.Constructor and Description |
---|
OutputCaptureRule() |
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
void |
expect(org.hamcrest.Matcher<? super String> matcher)
Verify that the output is matched by the supplied
matcher . |
void |
reset()
Deprecated.
since 2.2 with no replacement
|
String |
toString() |
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
@Deprecated public void reset()
public void expect(org.hamcrest.Matcher<? super String> matcher)
matcher
. Verification is
performed after the test method has executed.matcher
- the matcherCopyright © 2019 Pivotal Software, Inc.. All rights reserved.