Annotation parameter scan finds first-level conflicts
Closes PR-16312
This commit is contained in:
@@ -319,6 +319,13 @@ public class UniqueSecurityAnnotationScannerTests {
|
||||
assertThat(pre).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void scanParameterAnnotationWhenPresentInParentAndInterfaceThenException() throws Exception {
|
||||
Parameter parameter = DefaultUserService.class.getDeclaredMethod("batch", String[].class).getParameters()[0];
|
||||
assertThatExceptionOfType(AnnotationConfigurationException.class)
|
||||
.isThrownBy(() -> this.parameterScanner.scan(parameter));
|
||||
}
|
||||
|
||||
interface UserService {
|
||||
|
||||
void add(@CustomParameterAnnotation("one") String user);
|
||||
@@ -345,6 +352,8 @@ public class UniqueSecurityAnnotationScannerTests {
|
||||
|
||||
interface RemoteUserService extends ThirdPartyUserService {
|
||||
|
||||
void batch(@CustomParameterAnnotation("six") String... user);
|
||||
|
||||
}
|
||||
|
||||
static class UserServiceImpl implements UserService, OtherUserService, RemoteUserService {
|
||||
@@ -369,6 +378,20 @@ public class UniqueSecurityAnnotationScannerTests {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batch(@CustomParameterAnnotation("seven") String... user) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class DefaultUserService extends UserServiceImpl implements RemoteUserService {
|
||||
|
||||
@Override
|
||||
public void batch(String... user) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Target({ ElementType.PARAMETER })
|
||||
|
||||
Reference in New Issue
Block a user