-
Notifications
You must be signed in to change notification settings - Fork 791
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
Add @FeignTest annotation for Feign Layer #427
Comments
Hello, thanks for proposing this. |
Thank for reply |
Hey @OlgaMaciaszek. I came across this issue and wanted to share something I did recently at work (and used with success): If you find this (or something with this shape) worth adding - I'd be glad to contribute (preceded with some guidance). |
@OlgaMaciaszek trying to draw a little more attention :) I can try and submit a MR request already, but still got some concerns about how to do it right. |
Hello!
I started to integrate Spring Cloud Contract into existing project.
No problems on producer side. Base test class annotated with @WebMvcTest, so only Web Layer getting configured and has same state as for production deployment. Services mocked, Web works, tests passed, stubs published
Issue comes on consumer side.
We are using Feign as client. So Preferable solution is to create test, inject FeignClient with same configuration, as for production deployment and perform http requests using using Feign abstraction.
Example from documentation:
This will work, but in services with complex configuration it is difficult to create such configuration (@SpringBootTest).
All properties must be set, production only beans must be mocked, etc. More over - there is no need for Feign tests to create all service, configuration and controller beans.
So existent of special annotation for Feign Client Layer Test (@FeignTest) will helps a lot and sounds reasonable.
But to create this annotation deep knowledge of all Feign related spring auto configurations required (web converters, ribbon, eureka, jackson, etc.)
It would be great, if you will able to implement this annotation.
Thanks in advance,
Yesman Maxim.
The text was updated successfully, but these errors were encountered: