Commit 444f3c80 by Dave Syer

Feign client builder should not assume all annotations are the same

Simple solution is to check for instanceof before casting. Fixes gh-265
parent b03b2f56
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment