Make JUnit Jupiter support classes package private
Issue: SPR-13575
This commit is contained in:
parent
045c678622
commit
9a9551bf18
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.context.junit.jupiter.support;
|
||||
package org.springframework.test.context.junit.jupiter;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Executable;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.context.junit.jupiter.support;
|
||||
package org.springframework.test.context.junit.jupiter;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.AnnotatedElement;
|
||||
|
@ -32,8 +32,6 @@ import org.springframework.context.ApplicationContext;
|
|||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
|
||||
import static org.springframework.core.annotation.AnnotatedElementUtils.hasAnnotation;
|
||||
|
||||
/**
|
||||
* Collection of utilities related to autowiring of individual method parameters.
|
||||
*
|
||||
|
@ -43,7 +41,7 @@ import static org.springframework.core.annotation.AnnotatedElementUtils.hasAnnot
|
|||
* @see #isAutowirable(Parameter)
|
||||
* @see #resolveDependency(Parameter, Class, ApplicationContext)
|
||||
*/
|
||||
public abstract class ParameterAutowireUtils {
|
||||
abstract class ParameterAutowireUtils {
|
||||
|
||||
private ParameterAutowireUtils() {
|
||||
/* no-op */
|
||||
|
@ -58,11 +56,11 @@ public abstract class ParameterAutowireUtils {
|
|||
* {@link Qualifier @Qualifier}, or {@link Value @Value}.
|
||||
* @see #resolveDependency(Parameter, Class, ApplicationContext)
|
||||
*/
|
||||
public static boolean isAutowirable(Parameter parameter) {
|
||||
static boolean isAutowirable(Parameter parameter) {
|
||||
return ApplicationContext.class.isAssignableFrom(parameter.getType())
|
||||
|| hasAnnotation(parameter, Autowired.class)
|
||||
|| hasAnnotation(parameter, Qualifier.class)
|
||||
|| hasAnnotation(parameter, Value.class);
|
||||
|| AnnotatedElementUtils.hasAnnotation(parameter, Autowired.class)
|
||||
|| AnnotatedElementUtils.hasAnnotation(parameter, Qualifier.class)
|
||||
|| AnnotatedElementUtils.hasAnnotation(parameter, Value.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,7 +89,7 @@ public abstract class ParameterAutowireUtils {
|
|||
* @see MethodParameterFactory#createSynthesizingMethodParameter(Parameter)
|
||||
* @see AutowireCapableBeanFactory#resolveDependency(DependencyDescriptor, String)
|
||||
*/
|
||||
public static Object resolveDependency(Parameter parameter, Class<?> containingClass,
|
||||
static Object resolveDependency(Parameter parameter, Class<?> containingClass,
|
||||
ApplicationContext applicationContext) {
|
||||
|
||||
boolean required = findMergedAnnotation(parameter, Autowired.class).map(Autowired::required).orElse(true);
|
|
@ -38,7 +38,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.test.context.TestContextManager;
|
||||
import org.springframework.test.context.junit.jupiter.support.ParameterAutowireUtils;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Internal support classes for integrating the <em>Spring TestContext Framework</em>
|
||||
* with the JUnit Jupiter extension model in JUnit 5.
|
||||
*/
|
||||
package org.springframework.test.context.junit.jupiter.support;
|
Loading…
Reference in New Issue