Test service that uses eureka and ribbon

Viewed 3369

I'm building an application using microservices with the netflix stack and spring boot. One thing that bugs me is that I have no integration tests yet, where I can mock the surrounding services.

So, I have service A which is a eureka client with ribbon to resolve the eureka name to the URL of a registered service B during a call.

So ideally I want to start the application with the integrationtest annotations of spring boot, use wiremock to simulate the service B and then call the method of service A, this should call my mocked service B using the symbolic name of the service.

Did anyone already solve this? I have searched for blog entries etc. of people doing this already, but couldn't find any...

I know of the SO article Mock an Eureka Feign Client for Unittesting but as far as I can see this just prevents the discovery client from complaining.

2 Answers
Related