This commit is contained in:
Phillip Webb
2020-04-07 12:10:49 -07:00
parent 1640add8be
commit 3ca896e63f
28 changed files with 66 additions and 73 deletions

View File

@@ -376,6 +376,7 @@ public abstract class AbstractApplicationContextRunner<SELF extends AbstractAppl
* @param consumer the consumer of the created {@link ApplicationContext}
* @return this instance
*/
@SuppressWarnings("unchecked")
public SELF run(ContextConsumer<? super A> consumer) {
withContextClassLoader(this.classLoader, () -> this.systemProperties.applyToSystemProperties(() -> {
try (A context = createAssertableContext()) {

View File

@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.hamcrest.Matcher;
import org.junit.Assert;
import org.hamcrest.MatcherAssert;
import org.junit.Rule;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
@@ -70,7 +70,7 @@ public class OutputCaptureRule implements TestRule, CapturedOutput {
try {
if (!OutputCaptureRule.this.matchers.isEmpty()) {
String output = OutputCaptureRule.this.delegate.toString();
Assert.assertThat(output, allOf(OutputCaptureRule.this.matchers));
MatcherAssert.assertThat(output, allOf(OutputCaptureRule.this.matchers));
}
}
finally {