Add AssertJ checkstyle rule

Closes gh-5083
This commit is contained in:
Phillip Webb
2016-02-05 21:57:38 -08:00
parent c5add2ef08
commit cc5d4b8b7f
2 changed files with 10 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.List;
import org.hamcrest.Matcher;
import org.junit.Assert;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
@@ -32,7 +33,6 @@ import org.springframework.boot.ansi.AnsiOutput;
import org.springframework.boot.ansi.AnsiOutput.Enabled;
import static org.hamcrest.Matchers.allOf;
import static org.junit.Assert.assertThat;
/**
* JUnit {@code @Rule} to capture output from System.out and System.err.
@@ -63,7 +63,7 @@ public class OutputCapture implements TestRule {
try {
if (!OutputCapture.this.matchers.isEmpty()) {
String output = OutputCapture.this.toString();
assertThat(output, allOf(OutputCapture.this.matchers));
Assert.assertThat(output, allOf(OutputCapture.this.matchers));
}
}
finally {