Make JUnit Jupiter support classes package private

Issue: SPR-13575
This commit is contained in:
Sam Brannen 2016-07-05 17:09:08 +02:00
parent 045c678622
commit 9a9551bf18
4 changed files with 8 additions and 16 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;
/**

View File

@ -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;