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:
@@ -23,9 +23,10 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
/**
|
||||
* Annotation used in combination with {@link ModifiedClassPathExtension} to exclude
|
||||
* entries from the classpath.
|
||||
* Annotation used to exclude entries from the classpath.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 1.5.0
|
||||
@@ -33,6 +34,7 @@ import java.lang.annotation.Target;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Documented
|
||||
@ExtendWith(ModifiedClassPathExtension.class)
|
||||
public @interface ClassPathExclusions {
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,9 +22,10 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
/**
|
||||
* Annotation used in combination with {@link ModifiedClassPathExtension} to override
|
||||
* entries on the classpath.
|
||||
* Annotation used to override entries on the classpath.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 1.5.0
|
||||
@@ -32,6 +33,7 @@ import java.lang.annotation.Target;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Documented
|
||||
@ExtendWith(ModifiedClassPathExtension.class)
|
||||
public @interface ClassPathOverrides {
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,9 +41,8 @@ import org.springframework.util.ReflectionUtils;
|
||||
* test class and as the thread context class loader while the test is being run.
|
||||
*
|
||||
* @author Christoph Dreis
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public class ModifiedClassPathExtension implements InvocationInterceptor {
|
||||
class ModifiedClassPathExtension implements InvocationInterceptor {
|
||||
|
||||
@Override
|
||||
public void interceptBeforeAllMethod(Invocation<Void> invocation,
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.boot.testsupport.runner.classpath;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.hamcrest.Matchers.isA;
|
||||
@@ -28,7 +27,6 @@ import static org.hamcrest.Matchers.isA;
|
||||
*
|
||||
* @author Christoph Dreis
|
||||
*/
|
||||
@ExtendWith(ModifiedClassPathExtension.class)
|
||||
@ClassPathExclusions("hibernate-validator-*.jar")
|
||||
class ModifiedClassPathExtensionExclusionsTests {
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.boot.testsupport.runner.classpath;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -29,7 +28,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Christoph Dreis
|
||||
*/
|
||||
@ExtendWith(ModifiedClassPathExtension.class)
|
||||
@ClassPathOverrides("org.springframework:spring-context:4.1.0.RELEASE")
|
||||
class ModifiedClassPathExtensionOverridesTests {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user