Make ModifiedClassPathExtension package private

Meta-annotate `ClassPathExclusions` and `ClassPathOverrides` with
so that the `ModifiedClassPathExtension` no longer needs to be
used directly.

See gh-17491
This commit is contained in:
Phillip Webb
2019-07-15 13:27:45 +01:00
parent b6ec1332a0
commit 1117fdb2b3
40 changed files with 9 additions and 113 deletions

View File

@@ -19,13 +19,11 @@ package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.core.instrument.binder.logging.Log4j2Metrics;
import org.apache.logging.log4j.LogManager;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.testsupport.runner.classpath.ClassPathOverrides;
import org.springframework.boot.testsupport.runner.classpath.ModifiedClassPathExtension;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -36,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Andy Wilkinson
*/
@ExtendWith(ModifiedClassPathExtension.class)
@ClassPathOverrides("org.apache.logging.log4j:log4j-core:2.11.1")
class Log4J2MetricsWithLog4jLoggerContextAutoConfigurationTests {

View File

@@ -18,12 +18,10 @@ package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.core.instrument.binder.logging.LogbackMetrics;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.testsupport.runner.classpath.ClassPathOverrides;
import org.springframework.boot.testsupport.runner.classpath.ModifiedClassPathExtension;
import static org.assertj.core.api.Assertions.assertThat;
@@ -33,7 +31,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Andy Wilkinson
*/
@ExtendWith(ModifiedClassPathExtension.class)
@ClassPathOverrides({ "org.apache.logging.log4j:log4j-core:2.9.0", "org.apache.logging.log4j:log4j-slf4j-impl:2.9.0" })
class MetricsAutoConfigurationWithLog4j2AndLogbackTests {

View File

@@ -17,7 +17,6 @@
package org.springframework.boot.actuate.autoconfigure.redis;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
@@ -27,7 +26,6 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.testsupport.runner.classpath.ClassPathExclusions;
import org.springframework.boot.testsupport.runner.classpath.ModifiedClassPathExtension;
import static org.assertj.core.api.Assertions.assertThat;
@@ -36,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Phillip Webb
*/
@ExtendWith(ModifiedClassPathExtension.class)
@ClassPathExclusions({ "reactor-core*.jar", "lettuce-core*.jar" })
class RedisHealthIndicatorAutoConfigurationTests {

View File

@@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.web.jersey;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.servlet.ServletContainer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer;
@@ -28,7 +27,6 @@ import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.boot.testsupport.runner.classpath.ClassPathExclusions;
import org.springframework.boot.testsupport.runner.classpath.ModifiedClassPathExtension;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -43,7 +41,6 @@ import static org.mockito.Mockito.verify;
* @author Andy Wilkinson
* @author Madhura Bhave
*/
@ExtendWith(ModifiedClassPathExtension.class)
@ClassPathExclusions("spring-webmvc-*")
class JerseyChildManagementContextConfigurationTests {

View File

@@ -18,7 +18,6 @@ package org.springframework.boot.actuate.autoconfigure.web.jersey;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.servlet.ServletContainer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer;
@@ -28,7 +27,6 @@ import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.boot.testsupport.runner.classpath.ClassPathExclusions;
import org.springframework.boot.testsupport.runner.classpath.ModifiedClassPathExtension;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -42,7 +40,6 @@ import static org.mockito.Mockito.verify;
*
* @author Madhura Bhave
*/
@ExtendWith(ModifiedClassPathExtension.class)
@ClassPathExclusions("spring-webmvc-*")
class JerseySameManagementContextConfigurationTests {