Skip to content

Commit 77bce14

Browse files
committed
Polish Annotation Test
This new arrangement of the test better matches the class hierarchy described by the original ticket. Issue gh-13234
1 parent 90335bd commit 77bce14

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

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

7272
@Test
7373
void synthesizeWhenInterfaceOverridingMultipleInterfaceInheritanceThenResolves() throws Exception {
74-
Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method");
74+
Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class
75+
.getDeclaredMethod("method");
7576
PreAuthorize preAuthorize = this.synthesizer.synthesize(method);
7677
assertThat(preAuthorize.value()).isEqualTo("ten");
7778
}
@@ -198,10 +199,10 @@ void synthesizeWhenMultipleMethodInheritanceThenException() throws Exception {
198199

199200
// gh-13234
200201
@Test
201-
void synthesizeWhenClassInheritingGrandparentInterfaceAnnotationThenResolves() throws Exception {
202-
Method method = ClassInheritingGrandparentInterfaceAnnotation.class.getDeclaredMethod("method");
202+
void synthesizeWhenClassInheritingInterfaceAnnotationThenResolves() throws Exception {
203+
Method method = ClassInheritingInterfaceMethodAnnotation.class.getDeclaredMethod("method");
203204
PreAuthorize preAuthorize = this.synthesizer.synthesize(method);
204-
assertThat(preAuthorize.value()).isEqualTo("one");
205+
assertThat(preAuthorize.value()).isEqualTo("three");
205206
}
206207

207208
@Test
@@ -312,10 +313,12 @@ private interface InterfaceOverridingMultipleInterfaceInheritance
312313

313314
private static class ClassInheritingInterfaceOverridingMultipleInterfaceInheritance
314315
implements InterfaceOverridingMultipleInterfaceInheritance {
316+
315317
@Override
316318
public String method() {
317319
return "ok";
318320
}
321+
319322
}
320323

321324
private interface InterfaceMethodOverridingMultipleInterfaceInheritance
@@ -498,8 +501,7 @@ private interface InterfaceInheritingInterfaceAnnotation extends AnnotationOnInt
498501

499502
}
500503

501-
private static class ClassInheritingGrandparentInterfaceAnnotation
502-
implements InterfaceInheritingInterfaceAnnotation {
504+
private static class ClassInheritingInterfaceMethodAnnotation implements AnnotationOnInterfaceMethod {
503505

504506
@Override
505507
public String method() {

0 commit comments

Comments
 (0)