mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-07 19:22:14 +00:00
Polish Annotation Test
This new arrangement of the test better matches the class hierarchy described by the original ticket. Issue gh-13234
This commit is contained in:
parent
90335bd0a6
commit
77bce14462
@ -71,7 +71,8 @@ public class UniqueMergedAnnotationSynthesizerTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void synthesizeWhenInterfaceOverridingMultipleInterfaceInheritanceThenResolves() throws Exception {
|
void synthesizeWhenInterfaceOverridingMultipleInterfaceInheritanceThenResolves() throws Exception {
|
||||||
Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method");
|
Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class
|
||||||
|
.getDeclaredMethod("method");
|
||||||
PreAuthorize preAuthorize = this.synthesizer.synthesize(method);
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method);
|
||||||
assertThat(preAuthorize.value()).isEqualTo("ten");
|
assertThat(preAuthorize.value()).isEqualTo("ten");
|
||||||
}
|
}
|
||||||
@ -198,10 +199,10 @@ public class UniqueMergedAnnotationSynthesizerTests {
|
|||||||
|
|
||||||
// gh-13234
|
// gh-13234
|
||||||
@Test
|
@Test
|
||||||
void synthesizeWhenClassInheritingGrandparentInterfaceAnnotationThenResolves() throws Exception {
|
void synthesizeWhenClassInheritingInterfaceAnnotationThenResolves() throws Exception {
|
||||||
Method method = ClassInheritingGrandparentInterfaceAnnotation.class.getDeclaredMethod("method");
|
Method method = ClassInheritingInterfaceMethodAnnotation.class.getDeclaredMethod("method");
|
||||||
PreAuthorize preAuthorize = this.synthesizer.synthesize(method);
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method);
|
||||||
assertThat(preAuthorize.value()).isEqualTo("one");
|
assertThat(preAuthorize.value()).isEqualTo("three");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -312,10 +313,12 @@ public class UniqueMergedAnnotationSynthesizerTests {
|
|||||||
|
|
||||||
private static class ClassInheritingInterfaceOverridingMultipleInterfaceInheritance
|
private static class ClassInheritingInterfaceOverridingMultipleInterfaceInheritance
|
||||||
implements InterfaceOverridingMultipleInterfaceInheritance {
|
implements InterfaceOverridingMultipleInterfaceInheritance {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String method() {
|
public String method() {
|
||||||
return "ok";
|
return "ok";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private interface InterfaceMethodOverridingMultipleInterfaceInheritance
|
private interface InterfaceMethodOverridingMultipleInterfaceInheritance
|
||||||
@ -498,8 +501,7 @@ public class UniqueMergedAnnotationSynthesizerTests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class ClassInheritingGrandparentInterfaceAnnotation
|
private static class ClassInheritingInterfaceMethodAnnotation implements AnnotationOnInterfaceMethod {
|
||||||
implements InterfaceInheritingInterfaceAnnotation {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String method() {
|
public String method() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user