Skip to content

Commit

Permalink
Polish Annotation Test
Browse files Browse the repository at this point in the history
This new arrangement of the test better matches the class
hierarchy described by the original ticket.

Issue gh-13234
  • Loading branch information
jzheaux committed Jul 31, 2024
1 parent 90335bd commit 77bce14
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -312,10 +313,12 @@ private interface InterfaceOverridingMultipleInterfaceInheritance

private static class ClassInheritingInterfaceOverridingMultipleInterfaceInheritance
implements InterfaceOverridingMultipleInterfaceInheritance {

@Override
public String method() {
return "ok";
}

}

private interface InterfaceMethodOverridingMultipleInterfaceInheritance
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 77bce14

Please sign in to comment.