|
|
|
@ -37,35 +37,35 @@ public class UniqueMergedAnnotationSynthesizerTests { |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenAnnotationOnInterfaceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenAnnotationOnInterfaceThenResolves() throws Exception { |
|
|
|
Method method = AnnotationOnInterface.class.getDeclaredMethod("method"); |
|
|
|
Method method = AnnotationOnInterface.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("one"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("one"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenAnnotationOnMethodThenResolves() throws Exception { |
|
|
|
void synthesizeWhenAnnotationOnMethodThenResolves() throws Exception { |
|
|
|
Method method = AnnotationOnInterfaceMethod.class.getDeclaredMethod("method"); |
|
|
|
Method method = AnnotationOnInterfaceMethod.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenAnnotationOnClassThenResolves() throws Exception { |
|
|
|
void synthesizeWhenAnnotationOnClassThenResolves() throws Exception { |
|
|
|
Method method = AnnotationOnClass.class.getDeclaredMethod("method"); |
|
|
|
Method method = AnnotationOnClass.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("five"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("five"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenAnnotationOnClassMethodThenResolves() throws Exception { |
|
|
|
void synthesizeWhenAnnotationOnClassMethodThenResolves() throws Exception { |
|
|
|
Method method = AnnotationOnClassMethod.class.getDeclaredMethod("method"); |
|
|
|
Method method = AnnotationOnClassMethod.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("six"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("six"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenInterfaceOverridingAnnotationOnInterfaceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenInterfaceOverridingAnnotationOnInterfaceThenResolves() throws Exception { |
|
|
|
Method method = InterfaceMethodOverridingAnnotationOnInterface.class.getDeclaredMethod("method"); |
|
|
|
Method method = InterfaceMethodOverridingAnnotationOnInterface.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("eight"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("eight"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -73,14 +73,14 @@ public class UniqueMergedAnnotationSynthesizerTests { |
|
|
|
void synthesizeWhenInterfaceOverridingMultipleInterfaceInheritanceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenInterfaceOverridingMultipleInterfaceInheritanceThenResolves() throws Exception { |
|
|
|
Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class |
|
|
|
Method method = ClassInheritingInterfaceOverridingMultipleInterfaceInheritance.class |
|
|
|
.getDeclaredMethod("method"); |
|
|
|
.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("ten"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("ten"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenInterfaceMethodOverridingAnnotationOnInterfaceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenInterfaceMethodOverridingAnnotationOnInterfaceThenResolves() throws Exception { |
|
|
|
Method method = InterfaceMethodOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = InterfaceMethodOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("eleven"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("eleven"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -88,63 +88,63 @@ public class UniqueMergedAnnotationSynthesizerTests { |
|
|
|
void synthesizeWhenClassMultipleInheritanceThenException() throws Exception { |
|
|
|
void synthesizeWhenClassMultipleInheritanceThenException() throws Exception { |
|
|
|
Method method = ClassAttemptingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassAttemptingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); |
|
|
|
assertThatExceptionOfType(AnnotationConfigurationException.class) |
|
|
|
assertThatExceptionOfType(AnnotationConfigurationException.class) |
|
|
|
.isThrownBy(() -> this.synthesizer.synthesize(method)); |
|
|
|
.isThrownBy(() -> this.synthesizer.synthesize(method, method.getDeclaringClass())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// gh-15097
|
|
|
|
// gh-15097
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassOverridingMultipleInterfaceInheritanceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassOverridingMultipleInterfaceInheritanceThenResolves() throws Exception { |
|
|
|
Method method = ClassOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("thirteen"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("thirteen"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassMethodOverridingMultipleInterfaceInheritanceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassMethodOverridingMultipleInterfaceInheritanceThenResolves() throws Exception { |
|
|
|
Method method = ClassMethodOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassMethodOverridingMultipleInterfaceInheritance.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("fourteen"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("fourteen"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassInheritingInterfaceOverridingInterfaceAnnotationThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassInheritingInterfaceOverridingInterfaceAnnotationThenResolves() throws Exception { |
|
|
|
Method method = ClassInheritingInterfaceOverridingInterfaceAnnotation.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassInheritingInterfaceOverridingInterfaceAnnotation.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("seven"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("seven"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassOverridingGrandparentInterfaceAnnotationThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassOverridingGrandparentInterfaceAnnotationThenResolves() throws Exception { |
|
|
|
Method method = ClassOverridingGrandparentInterfaceAnnotation.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassOverridingGrandparentInterfaceAnnotation.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("sixteen"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("sixteen"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenMethodOverridingGrandparentInterfaceAnnotationThenResolves() throws Exception { |
|
|
|
void synthesizeWhenMethodOverridingGrandparentInterfaceAnnotationThenResolves() throws Exception { |
|
|
|
Method method = MethodOverridingGrandparentInterfaceAnnotation.class.getDeclaredMethod("method"); |
|
|
|
Method method = MethodOverridingGrandparentInterfaceAnnotation.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("seventeen"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("seventeen"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassInheritingMethodOverriddenAnnotationThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassInheritingMethodOverriddenAnnotationThenResolves() throws Exception { |
|
|
|
Method method = ClassInheritingMethodOverriddenAnnotation.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassInheritingMethodOverriddenAnnotation.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("eight"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("eight"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassOverridingMethodOverriddenAnnotationThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassOverridingMethodOverriddenAnnotationThenResolves() throws Exception { |
|
|
|
Method method = ClassOverridingMethodOverriddenAnnotation.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassOverridingMethodOverriddenAnnotation.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("eight"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("eight"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenMethodOverridingMethodOverriddenAnnotationThenResolves() throws Exception { |
|
|
|
void synthesizeWhenMethodOverridingMethodOverriddenAnnotationThenResolves() throws Exception { |
|
|
|
Method method = MethodOverridingMethodOverriddenAnnotation.class.getDeclaredMethod("method"); |
|
|
|
Method method = MethodOverridingMethodOverriddenAnnotation.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twenty"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twenty"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -152,41 +152,41 @@ public class UniqueMergedAnnotationSynthesizerTests { |
|
|
|
void synthesizeWhenClassInheritingMultipleInheritanceThenException() throws Exception { |
|
|
|
void synthesizeWhenClassInheritingMultipleInheritanceThenException() throws Exception { |
|
|
|
Method method = ClassInheritingMultipleInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassInheritingMultipleInheritance.class.getDeclaredMethod("method"); |
|
|
|
assertThatExceptionOfType(AnnotationConfigurationException.class) |
|
|
|
assertThatExceptionOfType(AnnotationConfigurationException.class) |
|
|
|
.isThrownBy(() -> this.synthesizer.synthesize(method)); |
|
|
|
.isThrownBy(() -> this.synthesizer.synthesize(method, method.getDeclaringClass())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassOverridingMultipleInheritanceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassOverridingMultipleInheritanceThenResolves() throws Exception { |
|
|
|
Method method = ClassOverridingMultipleInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassOverridingMultipleInheritance.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentytwo"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentytwo"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenMethodOverridingMultipleInheritanceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenMethodOverridingMultipleInheritanceThenResolves() throws Exception { |
|
|
|
Method method = MethodOverridingMultipleInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = MethodOverridingMultipleInheritance.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentythree"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentythree"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenInheritingInterfaceAndMethodAnnotationsThenResolves() throws Exception { |
|
|
|
void synthesizeWhenInheritingInterfaceAndMethodAnnotationsThenResolves() throws Exception { |
|
|
|
Method method = InheritingInterfaceAndMethodAnnotations.class.getDeclaredMethod("method"); |
|
|
|
Method method = InheritingInterfaceAndMethodAnnotations.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassOverridingInterfaceAndMethodInheritanceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassOverridingInterfaceAndMethodInheritanceThenResolves() throws Exception { |
|
|
|
Method method = ClassOverridingInterfaceAndMethodInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassOverridingInterfaceAndMethodInheritance.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenMethodOverridingInterfaceAndMethodInheritanceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenMethodOverridingInterfaceAndMethodInheritanceThenResolves() throws Exception { |
|
|
|
Method method = MethodOverridingInterfaceAndMethodInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = MethodOverridingInterfaceAndMethodInheritance.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentysix"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentysix"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -194,21 +194,21 @@ public class UniqueMergedAnnotationSynthesizerTests { |
|
|
|
void synthesizeWhenMultipleMethodInheritanceThenException() throws Exception { |
|
|
|
void synthesizeWhenMultipleMethodInheritanceThenException() throws Exception { |
|
|
|
Method method = MultipleMethodInheritance.class.getDeclaredMethod("method"); |
|
|
|
Method method = MultipleMethodInheritance.class.getDeclaredMethod("method"); |
|
|
|
assertThatExceptionOfType(AnnotationConfigurationException.class) |
|
|
|
assertThatExceptionOfType(AnnotationConfigurationException.class) |
|
|
|
.isThrownBy(() -> this.synthesizer.synthesize(method)); |
|
|
|
.isThrownBy(() -> this.synthesizer.synthesize(method, method.getDeclaringClass())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// gh-13234
|
|
|
|
// gh-13234
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassInheritingInterfaceAnnotationThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassInheritingInterfaceAnnotationThenResolves() throws Exception { |
|
|
|
Method method = ClassInheritingInterfaceMethodAnnotation.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassInheritingInterfaceMethodAnnotation.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenMethodInheritingMethodOverridingInterfaceAndMethodInheritanceThenResolves() throws Exception { |
|
|
|
void synthesizeWhenMethodInheritingMethodOverridingInterfaceAndMethodInheritanceThenResolves() throws Exception { |
|
|
|
Method method = MethodInheritingMethodOverridingInterfaceAndMethodInheritance.class.getMethod("method"); |
|
|
|
Method method = MethodInheritingMethodOverridingInterfaceAndMethodInheritance.class.getMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentysix"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentysix"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -224,13 +224,13 @@ public class UniqueMergedAnnotationSynthesizerTests { |
|
|
|
void synthesizeWhenInterfaceInheritingAnnotationsAtDifferentLevelsThenException() throws Exception { |
|
|
|
void synthesizeWhenInterfaceInheritingAnnotationsAtDifferentLevelsThenException() throws Exception { |
|
|
|
Method method = InterfaceInheritingAnnotationsAtDifferentLevels.class.getMethod("method"); |
|
|
|
Method method = InterfaceInheritingAnnotationsAtDifferentLevels.class.getMethod("method"); |
|
|
|
assertThatExceptionOfType(AnnotationConfigurationException.class) |
|
|
|
assertThatExceptionOfType(AnnotationConfigurationException.class) |
|
|
|
.isThrownBy(() -> this.synthesizer.synthesize(method)); |
|
|
|
.isThrownBy(() -> this.synthesizer.synthesize(method, method.getDeclaringClass())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassMethodOverridingAnnotationOnMethodThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassMethodOverridingAnnotationOnMethodThenResolves() throws Exception { |
|
|
|
Method method = ClassMethodOverridingAnnotationOnMethod.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassMethodOverridingAnnotationOnMethod.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentyeight"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("twentyeight"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -238,7 +238,7 @@ public class UniqueMergedAnnotationSynthesizerTests { |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void synthesizeWhenClassInheritingInterfaceInheritingInterfaceMethodAnnotationThenResolves() throws Exception { |
|
|
|
void synthesizeWhenClassInheritingInterfaceInheritingInterfaceMethodAnnotationThenResolves() throws Exception { |
|
|
|
Method method = ClassInheritingInterfaceInheritingInterfaceMethodAnnotation.class.getDeclaredMethod("method"); |
|
|
|
Method method = ClassInheritingInterfaceInheritingInterfaceMethodAnnotation.class.getDeclaredMethod("method"); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method); |
|
|
|
PreAuthorize preAuthorize = this.synthesizer.synthesize(method, method.getDeclaringClass()); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
assertThat(preAuthorize.value()).isEqualTo("three"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|