14
14
* limitations under the License.
15
15
*/
16
16
17
- package org .springframework .test .context .junit .jupiter . support ;
17
+ package org .springframework .test .context .junit .jupiter ;
18
18
19
19
import java .lang .annotation .Annotation ;
20
20
import java .lang .reflect .AnnotatedElement ;
32
32
import org .springframework .core .MethodParameter ;
33
33
import org .springframework .core .annotation .AnnotatedElementUtils ;
34
34
35
- import static org .springframework .core .annotation .AnnotatedElementUtils .hasAnnotation ;
36
-
37
35
/**
38
36
* Collection of utilities related to autowiring of individual method parameters.
39
37
*
43
41
* @see #isAutowirable(Parameter)
44
42
* @see #resolveDependency(Parameter, Class, ApplicationContext)
45
43
*/
46
- public abstract class ParameterAutowireUtils {
44
+ abstract class ParameterAutowireUtils {
47
45
48
46
private ParameterAutowireUtils () {
49
47
/* no-op */
@@ -58,11 +56,11 @@ private ParameterAutowireUtils() {
58
56
* {@link Qualifier @Qualifier}, or {@link Value @Value}.
59
57
* @see #resolveDependency(Parameter, Class, ApplicationContext)
60
58
*/
61
- public static boolean isAutowirable (Parameter parameter ) {
59
+ static boolean isAutowirable (Parameter parameter ) {
62
60
return ApplicationContext .class .isAssignableFrom (parameter .getType ())
63
- || hasAnnotation (parameter , Autowired .class )
64
- || hasAnnotation (parameter , Qualifier .class )
65
- || hasAnnotation (parameter , Value .class );
61
+ || AnnotatedElementUtils . hasAnnotation (parameter , Autowired .class )
62
+ || AnnotatedElementUtils . hasAnnotation (parameter , Qualifier .class )
63
+ || AnnotatedElementUtils . hasAnnotation (parameter , Value .class );
66
64
}
67
65
68
66
/**
@@ -91,7 +89,7 @@ public static boolean isAutowirable(Parameter parameter) {
91
89
* @see MethodParameterFactory#createSynthesizingMethodParameter(Parameter)
92
90
* @see AutowireCapableBeanFactory#resolveDependency(DependencyDescriptor, String)
93
91
*/
94
- public static Object resolveDependency (Parameter parameter , Class <?> containingClass ,
92
+ static Object resolveDependency (Parameter parameter , Class <?> containingClass ,
95
93
ApplicationContext applicationContext ) {
96
94
97
95
boolean required = findMergedAnnotation (parameter , Autowired .class ).map (Autowired ::required ).orElse (true );
0 commit comments