@@ -178,6 +178,13 @@ public void findMethodAnnotationFromInterface() throws Exception {
178
178
assertNotNull (order );
179
179
}
180
180
181
+ @ Test // SPR-16060
182
+ public void findMethodAnnotationFromGenericInterface () throws Exception {
183
+ Method method = ImplementsInterfaceWithGenericAnnotatedMethod .class .getMethod ("foo" , String .class );
184
+ Order order = findAnnotation (method , Order .class );
185
+ assertNotNull (order );
186
+ }
187
+
181
188
@ Test
182
189
public void findMethodAnnotationFromInterfaceOnSuper () throws Exception {
183
190
Method method = SubOfImplementsInterfaceWithAnnotatedMethod .class .getMethod ("foo" );
@@ -286,7 +293,7 @@ public void findClassAnnotationOnSubSubNonInheritedAnnotationInterface() {
286
293
}
287
294
288
295
@ Test
289
- public void findAnnotationDeclaringClassForAllScenarios () throws Exception {
296
+ public void findAnnotationDeclaringClassForAllScenarios () {
290
297
// no class-level annotation
291
298
assertNull (findAnnotationDeclaringClass (Transactional .class , NonAnnotatedInterface .class ));
292
299
assertNull (findAnnotationDeclaringClass (Transactional .class , NonAnnotatedClass .class ));
@@ -395,7 +402,7 @@ public void isAnnotationDeclaredLocallyForAllScenarios() throws Exception {
395
402
}
396
403
397
404
@ Test
398
- public void isAnnotationInheritedForAllScenarios () throws Exception {
405
+ public void isAnnotationInheritedForAllScenarios () {
399
406
// no class-level annotation
400
407
assertFalse (isAnnotationInherited (Transactional .class , NonAnnotatedInterface .class ));
401
408
assertFalse (isAnnotationInherited (Transactional .class , NonAnnotatedClass .class ));
@@ -504,7 +511,7 @@ public void getDefaultValueFromAnnotation() throws Exception {
504
511
}
505
512
506
513
@ Test
507
- public void getDefaultValueFromNonPublicAnnotation () throws Exception {
514
+ public void getDefaultValueFromNonPublicAnnotation () {
508
515
Annotation [] declaredAnnotations = NonPublicAnnotatedClass .class .getDeclaredAnnotations ();
509
516
assertEquals (1 , declaredAnnotations .length );
510
517
Annotation annotation = declaredAnnotations [0 ];
@@ -515,7 +522,7 @@ public void getDefaultValueFromNonPublicAnnotation() throws Exception {
515
522
}
516
523
517
524
@ Test
518
- public void getDefaultValueFromAnnotationType () throws Exception {
525
+ public void getDefaultValueFromAnnotationType () {
519
526
assertEquals (Ordered .LOWEST_PRECEDENCE , getDefaultValue (Order .class , VALUE ));
520
527
assertEquals (Ordered .LOWEST_PRECEDENCE , getDefaultValue (Order .class ));
521
528
}
@@ -547,7 +554,7 @@ public void getRepeatableAnnotationsDeclaredOnClassWithMissingAttributeAliasDecl
547
554
}
548
555
549
556
@ Test
550
- public void getRepeatableAnnotationsDeclaredOnClassWithAttributeAliases () throws Exception {
557
+ public void getRepeatableAnnotationsDeclaredOnClassWithAttributeAliases () {
551
558
final List <String > expectedLocations = asList ("A" , "B" );
552
559
553
560
Set <ContextConfig > annotations = getRepeatableAnnotations (ConfigHierarchyTestCase .class , ContextConfig .class , null );
@@ -1750,6 +1757,18 @@ public static class TransactionalAndOrderedClass extends TransactionalClass {
1750
1757
public static class SubTransactionalAndOrderedClass extends TransactionalAndOrderedClass {
1751
1758
}
1752
1759
1760
+ public interface InterfaceWithGenericAnnotatedMethod <T > {
1761
+
1762
+ @ Order
1763
+ void foo (T t );
1764
+ }
1765
+
1766
+ public static class ImplementsInterfaceWithGenericAnnotatedMethod implements InterfaceWithGenericAnnotatedMethod <String > {
1767
+
1768
+ public void foo (String t ) {
1769
+ }
1770
+ }
1771
+
1753
1772
public interface InterfaceWithAnnotatedMethod {
1754
1773
1755
1774
@ Order
0 commit comments