Feign client builder should not assume all annotations are the same
Simple solution is to check for instanceof before casting. Fixes gh-265
This commit is contained in:
@@ -45,6 +45,9 @@ public class SpringMvcContract extends Contract.BaseContract {
|
||||
@Override
|
||||
protected void processAnnotationOnMethod(MethodMetadata data,
|
||||
Annotation methodAnnotation, Method method) {
|
||||
if (!(methodAnnotation instanceof RequestMapping)) {
|
||||
return;
|
||||
}
|
||||
RequestMapping mapping = RequestMapping.class.cast(methodAnnotation);
|
||||
if (mapping != null) {
|
||||
// HTTP Method
|
||||
|
||||
@@ -46,6 +46,7 @@ public class FeignClientValidationTests {
|
||||
@FeignClient("foo")
|
||||
interface Client {
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/")
|
||||
@Deprecated
|
||||
String get();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user