diff --git a/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/OutputCapture.java b/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/InternalOutputCapture.java similarity index 98% rename from spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/OutputCapture.java rename to spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/InternalOutputCapture.java index 31dd58694e..a9fc9894fc 100644 --- a/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/OutputCapture.java +++ b/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/InternalOutputCapture.java @@ -30,7 +30,7 @@ import org.junit.runners.model.Statement; * * @author Phillip Webb */ -public class OutputCapture implements TestRule { +class InternalOutputCapture implements TestRule { private CaptureOutputStream captureOut; diff --git a/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java b/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java index c7da9d0834..a1e81d0d95 100644 --- a/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java +++ b/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java @@ -43,7 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class PropertiesLauncherTests { @Rule - public OutputCapture output = new OutputCapture(); + public InternalOutputCapture output = new InternalOutputCapture(); @Before public void setup() throws IOException { diff --git a/spring-boot/src/test/java/org/springframework/boot/BannerTests.java b/spring-boot/src/test/java/org/springframework/boot/BannerTests.java index 6a29ab05d3..140a6ea74b 100644 --- a/spring-boot/src/test/java/org/springframework/boot/BannerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/BannerTests.java @@ -22,7 +22,7 @@ import org.junit.After; import org.junit.Rule; import org.junit.Test; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; @@ -47,7 +47,7 @@ public class BannerTests { } @Rule - public OutputCapture out = new OutputCapture(); + public InternalOutputCapture out = new InternalOutputCapture(); @Test public void testDefaultBanner() throws Exception { diff --git a/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java b/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java index 02458a9eb1..176a074a72 100644 --- a/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java @@ -23,7 +23,7 @@ import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.context.annotation.Configuration; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; @@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class SimpleMainTests { @Rule - public OutputCapture outputCapture = new OutputCapture(); + public InternalOutputCapture outputCapture = new InternalOutputCapture(); private static final String SPRING_STARTUP = "root of context hierarchy"; diff --git a/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index e870e98976..11444ca2c3 100644 --- a/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -43,7 +43,7 @@ import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEven import org.springframework.boot.context.event.ApplicationPreparedEvent; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.context.event.ApplicationStartedEvent; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextInitializer; @@ -99,7 +99,7 @@ public class SpringApplicationTests { public ExpectedException thrown = ExpectedException.none(); @Rule - public OutputCapture output = new OutputCapture(); + public InternalOutputCapture output = new InternalOutputCapture(); private ConfigurableApplicationContext context; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializerTests.java index 6d9128ae50..ef7bb22e58 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializerTests.java @@ -33,7 +33,7 @@ import org.springframework.boot.context.configwarnings.dflt.InDefaultPackageWith import org.springframework.boot.context.configwarnings.orgspring.InOrgSpringPackageConfiguration; import org.springframework.boot.context.configwarnings.real.InRealButScanningProblemPackages; import org.springframework.boot.context.configwarnings.real.InRealPackageConfiguration; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import static org.assertj.core.api.Assertions.assertThat; @@ -52,7 +52,7 @@ public class ConfigurationWarningsApplicationContextInitializerTests { + "start due to a @ComponentScan of 'org.springframework'."; @Rule - public OutputCapture output = new OutputCapture(); + public InternalOutputCapture output = new InternalOutputCapture(); @Test public void logWarningInDefaultPackage() { diff --git a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java index a5a205ba63..0fddadeb8f 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java @@ -46,7 +46,7 @@ import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEven import org.springframework.boot.context.event.ApplicationPreparedEvent; import org.springframework.boot.env.EnumerableCompositePropertySource; import org.springframework.boot.env.EnvironmentPostProcessor; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Configuration; @@ -86,7 +86,7 @@ public class ConfigFileApplicationListenerTests { public ExpectedException expected = ExpectedException.none(); @Rule - public OutputCapture out = new OutputCapture(); + public InternalOutputCapture out = new InternalOutputCapture(); private ConfigurableApplicationContext context; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactoryTests.java b/spring-boot/src/test/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactoryTests.java index 7281267b47..efbfc9bd22 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactoryTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactoryTests.java @@ -45,7 +45,7 @@ import org.springframework.boot.context.embedded.AbstractEmbeddedServletContaine import org.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactoryTests; import org.springframework.boot.context.embedded.EmbeddedServletContainerException; import org.springframework.boot.context.embedded.Ssl; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.util.SocketUtils; @@ -70,7 +70,7 @@ public class TomcatEmbeddedServletContainerFactoryTests extends AbstractEmbeddedServletContainerFactoryTests { @Rule - public OutputCapture outputCapture = new OutputCapture(); + public InternalOutputCapture outputCapture = new InternalOutputCapture(); @Override protected TomcatEmbeddedServletContainerFactory getFactory() { diff --git a/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java b/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java index 8d02080a79..da44ab3fb8 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java @@ -29,7 +29,7 @@ import org.junit.Rule; import org.junit.Test; import org.springframework.boot.context.embedded.ErrorPage; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.http.HttpStatus; import org.springframework.mock.web.MockFilterChain; import org.springframework.mock.web.MockFilterConfig; @@ -65,7 +65,7 @@ public class ErrorPageFilterTests { private MockFilterChain chain = new MockFilterChain(); @Rule - public OutputCapture output = new OutputCapture(); + public InternalOutputCapture output = new InternalOutputCapture(); @Test public void notAnError() throws Exception { diff --git a/spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java index 34dd9722f9..371d0296bb 100644 --- a/spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java @@ -39,7 +39,7 @@ import org.springframework.boot.ApplicationPid; import org.springframework.boot.SpringApplication; import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.boot.logging.java.JavaLoggingSystem; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.context.event.ContextClosedEvent; import org.springframework.context.support.GenericApplicationContext; import org.springframework.test.context.support.TestPropertySourceUtils; @@ -68,7 +68,7 @@ public class LoggingApplicationListenerTests { public TemporaryFolder temporaryFolder = new TemporaryFolder(); @Rule - public OutputCapture outputCapture = new OutputCapture(); + public InternalOutputCapture outputCapture = new InternalOutputCapture(); private final LoggingApplicationListener initializer = new LoggingApplicationListener(); diff --git a/spring-boot/src/test/java/org/springframework/boot/logging/java/JavaLoggingSystemTests.java b/spring-boot/src/test/java/org/springframework/boot/logging/java/JavaLoggingSystemTests.java index a8a76eb0c1..fb4799a7cb 100644 --- a/spring-boot/src/test/java/org/springframework/boot/logging/java/JavaLoggingSystemTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/logging/java/JavaLoggingSystemTests.java @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.boot.logging.AbstractLoggingSystemTests; import org.springframework.boot.logging.LogLevel; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; @@ -56,7 +56,7 @@ public class JavaLoggingSystemTests extends AbstractLoggingSystemTests { getClass().getClassLoader()); @Rule - public OutputCapture output = new OutputCapture(); + public InternalOutputCapture output = new InternalOutputCapture(); private Jdk14Logger logger; diff --git a/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java b/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java index 0ae70b2c81..13fdb557b4 100644 --- a/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java @@ -35,8 +35,8 @@ import org.junit.Test; import org.springframework.boot.logging.AbstractLoggingSystemTests; import org.springframework.boot.logging.LogLevel; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.boot.testutil.Matched; -import org.springframework.boot.testutil.OutputCapture; import org.springframework.util.FileCopyUtils; import org.springframework.util.StringUtils; @@ -54,7 +54,7 @@ import static org.hamcrest.Matchers.not; public class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests { @Rule - public OutputCapture output = new OutputCapture(); + public InternalOutputCapture output = new InternalOutputCapture(); private final TestLog4J2LoggingSystem loggingSystem = new TestLog4J2LoggingSystem(); diff --git a/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java b/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java index 9924d6e436..462af524f9 100644 --- a/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java @@ -39,8 +39,8 @@ import org.springframework.boot.logging.AbstractLoggingSystemTests; import org.springframework.boot.logging.LogFile; import org.springframework.boot.logging.LogLevel; import org.springframework.boot.logging.LoggingInitializationContext; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.boot.testutil.Matched; -import org.springframework.boot.testutil.OutputCapture; import org.springframework.mock.env.MockEnvironment; import org.springframework.util.FileCopyUtils; import org.springframework.util.StringUtils; @@ -59,7 +59,7 @@ import static org.hamcrest.Matchers.not; public class LogbackLoggingSystemTests extends AbstractLoggingSystemTests { @Rule - public OutputCapture output = new OutputCapture(); + public InternalOutputCapture output = new InternalOutputCapture(); private final LogbackLoggingSystem loggingSystem = new LogbackLoggingSystem( getClass().getClassLoader()); diff --git a/spring-boot/src/test/java/org/springframework/boot/logging/logback/SpringBootJoranConfiguratorTests.java b/spring-boot/src/test/java/org/springframework/boot/logging/logback/SpringBootJoranConfiguratorTests.java index 6c07df82dc..46c49c57d7 100644 --- a/spring-boot/src/test/java/org/springframework/boot/logging/logback/SpringBootJoranConfiguratorTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/logging/logback/SpringBootJoranConfiguratorTests.java @@ -28,7 +28,7 @@ import org.slf4j.Logger; import org.slf4j.impl.StaticLoggerBinder; import org.springframework.boot.logging.LoggingInitializationContext; -import org.springframework.boot.testutil.OutputCapture; +import org.springframework.boot.testutil.InternalOutputCapture; import org.springframework.mock.env.MockEnvironment; import org.springframework.test.context.support.TestPropertySourceUtils; @@ -45,7 +45,7 @@ import static org.hamcrest.Matchers.not; public class SpringBootJoranConfiguratorTests { @Rule - public OutputCapture out = new OutputCapture(); + public InternalOutputCapture out = new InternalOutputCapture(); private MockEnvironment environment; diff --git a/spring-boot/src/test/java/org/springframework/boot/testutil/OutputCapture.java b/spring-boot/src/test/java/org/springframework/boot/testutil/InternalOutputCapture.java similarity index 93% rename from spring-boot/src/test/java/org/springframework/boot/testutil/OutputCapture.java rename to spring-boot/src/test/java/org/springframework/boot/testutil/InternalOutputCapture.java index 89b1faf5b0..a00f427caa 100644 --- a/spring-boot/src/test/java/org/springframework/boot/testutil/OutputCapture.java +++ b/spring-boot/src/test/java/org/springframework/boot/testutil/InternalOutputCapture.java @@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.allOf; * @author Phillip Webb * @author Andy Wilkinson */ -public class OutputCapture implements TestRule { +public class InternalOutputCapture implements TestRule { private CaptureOutputStream captureOut; @@ -61,9 +61,9 @@ public class OutputCapture implements TestRule { } finally { try { - if (!OutputCapture.this.matchers.isEmpty()) { - String output = OutputCapture.this.toString(); - Assert.assertThat(output, allOf(OutputCapture.this.matchers)); + if (!InternalOutputCapture.this.matchers.isEmpty()) { + String output = InternalOutputCapture.this.toString(); + Assert.assertThat(output, allOf(InternalOutputCapture.this.matchers)); } } finally {