diff --git a/core/src/test/java/org/springframework/security/core/annotation/UniqueMergedAnnotationSynthesizerTests.java b/core/src/test/java/org/springframework/security/core/annotation/UniqueMergedAnnotationSynthesizerTests.java index 0728cd6383b..56fe18c52b3 100644 --- a/core/src/test/java/org/springframework/security/core/annotation/UniqueMergedAnnotationSynthesizerTests.java +++ b/core/src/test/java/org/springframework/security/core/annotation/UniqueMergedAnnotationSynthesizerTests.java @@ -71,7 +71,8 @@ void synthesizeWhenInterfaceOverridingAnnotationOnInterfaceThenResolves() throws @Test void synthesizeWhenInterfaceOverridingMultipleInterfaceInheritanceThenResolves() throws Exception { - Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); + Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class + .getDeclaredMethod("method"); PreAuthorize preAuthorize = this.synthesizer.synthesize(method); assertThat(preAuthorize.value()).isEqualTo("ten"); } @@ -198,10 +199,10 @@ void synthesizeWhenMultipleMethodInheritanceThenException() throws Exception { // gh-13234 @Test - void synthesizeWhenClassInheritingGrandparentInterfaceAnnotationThenResolves() throws Exception { - Method method = ClassInheritingGrandparentInterfaceAnnotation.class.getDeclaredMethod("method"); + void synthesizeWhenClassInheritingInterfaceAnnotationThenResolves() throws Exception { + Method method = ClassInheritingInterfaceMethodAnnotation.class.getDeclaredMethod("method"); PreAuthorize preAuthorize = this.synthesizer.synthesize(method); - assertThat(preAuthorize.value()).isEqualTo("one"); + assertThat(preAuthorize.value()).isEqualTo("three"); } @Test @@ -312,10 +313,12 @@ private interface InterfaceOverridingMultipleInterfaceInheritance private static class ClassInheritingInterfaceOverridingMultipleInterfaceInheritance implements InterfaceOverridingMultipleInterfaceInheritance { + @Override public String method() { return "ok"; } + } private interface InterfaceMethodOverridingMultipleInterfaceInheritance @@ -498,8 +501,7 @@ private interface InterfaceInheritingInterfaceAnnotation extends AnnotationOnInt } - private static class ClassInheritingGrandparentInterfaceAnnotation - implements InterfaceInheritingInterfaceAnnotation { + private static class ClassInheritingInterfaceMethodAnnotation implements AnnotationOnInterfaceMethod { @Override public String method() {