Skip to content

Commit 90335bd

Browse files
committed
Polish Annotation Test
This test was made more effective by having it focus on the real scenario of resolving annotations from the standpoint of a bean
1 parent b743d8f commit 90335bd

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

core/src/test/java/org/springframework/security/core/annotation/UniqueMergedAnnotationSynthesizerTests.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ void synthesizeWhenInterfaceOverridingAnnotationOnInterfaceThenResolves() throws
7171

7272
@Test
7373
void synthesizeWhenInterfaceOverridingMultipleInterfaceInheritanceThenResolves() throws Exception {
74-
Method method = InterfaceOverridingMultipleInterfaceInheritance.class.getMethod("method");
75-
PreAuthorize preAuthorize = this.synthesizer.synthesize(method,
76-
InterfaceOverridingMultipleInterfaceInheritance.class);
74+
Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method");
75+
PreAuthorize preAuthorize = this.synthesizer.synthesize(method);
7776
assertThat(preAuthorize.value()).isEqualTo("ten");
7877
}
7978

@@ -311,6 +310,14 @@ private interface InterfaceOverridingMultipleInterfaceInheritance
311310

312311
}
313312

313+
private static class ClassInheritingInterfaceOverridingMultipleInterfaceInheritance
314+
implements InterfaceOverridingMultipleInterfaceInheritance {
315+
@Override
316+
public String method() {
317+
return "ok";
318+
}
319+
}
320+
314321
private interface InterfaceMethodOverridingMultipleInterfaceInheritance
315322
extends AnnotationOnInterface, AlsoAnnotationOnInterface {
316323

0 commit comments

Comments
 (0)