Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in Capability invoke #2239

Closed

Conversation

JamieYoungYang
Copy link

to fix the bug, capability can't enrich the correct method
issue:#2237

Copy link
Member

@velo velo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a unit test please?

@JamieYoungYang
Copy link
Author

Can we get a unit test please?

Oh yes, of course

@@ -57,7 +57,7 @@ static Object enrich(Object componentToEnrich,
static Object invoke(Object target, Capability capability, Class<?> capabilityToEnrich) {
return Arrays.stream(capability.getClass().getMethods())
.filter(method -> method.getName().equals("enrich"))
.filter(method -> method.getReturnType().isAssignableFrom(capabilityToEnrich))
.filter(method -> method.getReturnType() == capabilityToEnrich)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work for Feign, all enrichers are based on interfaces....

I even wonder how this didn't broke any unit test.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work for Feign, all enrichers are based on interfaces....

I even wonder how this didn't broke any unit test.

I think you're right, if you look at the feign application as a whole, this rarely happens, since I'm thinking about the logic of this place in terms of this method, thank you, I'll close this pull request,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants