public abstract class Verifier extends Object implements TestRule
public static class ErrorLogVerifier {
private ErrorLog errorLog = new ErrorLog();
@Rule
public Verifier verifier = new Verifier() {
@Override public void verify() {
assertTrue(errorLog.isEmpty());
}
}
@Test public void testThatMightWriteErrorLog() {
// ...
}
}
| Constructor and Description |
|---|
Verifier() |
| Modifier and Type | Method and Description |
|---|---|
Statement |
apply(Statement base,
Description description)
Modifies the method-running
Statement to implement this
test-running rule. |
protected void |
verify()
Override this to add verification logic.
|
public Verifier()
public Statement apply(Statement base, Description description)
TestRuleStatement to implement this
test-running rule.apply in interface TestRulebase - The Statement to be modifieddescription - A Description of the test implemented in basebase,
a wrapper around base, or a completely new Statement.Copyright © 2002–2020 JUnit. All rights reserved.