1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public void testDirectAnnotationMatch() throws Exception {
49
49
@ Test
50
50
public void testInheritedAnnotationFromInterfaceDoesNotMatch () throws Exception {
51
51
MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory ();
52
- String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeSubClassOfSomeComponentInterface " ;
52
+ String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeClassWithSomeComponentInterface " ;
53
53
MetadataReader metadataReader = metadataReaderFactory .getMetadataReader (classUnderTest );
54
54
55
55
AnnotationTypeFilter filter = new AnnotationTypeFilter (InheritedAnnotation .class );
@@ -61,7 +61,7 @@ public void testInheritedAnnotationFromInterfaceDoesNotMatch() throws Exception
61
61
@ Test
62
62
public void testInheritedAnnotationFromBaseClassDoesMatch () throws Exception {
63
63
MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory ();
64
- String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeSubClassOfSomeComponent " ;
64
+ String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeSubclassOfSomeComponent " ;
65
65
MetadataReader metadataReader = metadataReaderFactory .getMetadataReader (classUnderTest );
66
66
67
67
AnnotationTypeFilter filter = new AnnotationTypeFilter (InheritedAnnotation .class );
@@ -94,22 +94,21 @@ public void testNonAnnotatedClassDoesntMatch() throws Exception {
94
94
95
95
@ Test
96
96
public void testMatchesInterfacesIfConfigured () throws Exception {
97
-
98
97
MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory ();
99
- String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeComponentInterface " ;
98
+ String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeClassWithSomeComponentInterface " ;
100
99
MetadataReader metadataReader = metadataReaderFactory .getMetadataReader (classUnderTest );
101
100
102
101
AnnotationTypeFilter filter = new AnnotationTypeFilter (InheritedAnnotation .class , false , true );
103
-
104
102
assertTrue (filter .match (metadataReader , metadataReaderFactory ));
105
103
ClassloadingAssertions .assertClassNotLoaded (classUnderTest );
106
104
}
107
105
106
+
108
107
// We must use a standalone set of types to ensure that no one else is loading them
109
108
// and interfering with ClassloadingAssertions.assertClassNotLoaded()
110
109
111
110
@ Inherited
112
- private static @interface InheritedAnnotation {
111
+ private @interface InheritedAnnotation {
113
112
}
114
113
115
114
@@ -119,21 +118,21 @@ private static class SomeComponent {
119
118
120
119
121
120
@ InheritedAnnotation
122
- private static interface SomeComponentInterface {
121
+ private interface SomeComponentInterface {
123
122
}
124
123
125
124
126
125
@ SuppressWarnings ("unused" )
127
- private static class SomeSubClassOfSomeComponentInterface implements SomeComponentInterface {
126
+ private static class SomeClassWithSomeComponentInterface implements Cloneable , SomeComponentInterface {
128
127
}
129
128
130
129
131
130
@ SuppressWarnings ("unused" )
132
- private static class SomeSubClassOfSomeComponent extends SomeComponent {
131
+ private static class SomeSubclassOfSomeComponent extends SomeComponent {
133
132
}
134
133
135
134
136
- private static @interface NonInheritedAnnotation {
135
+ private @interface NonInheritedAnnotation {
137
136
}
138
137
139
138
0 commit comments