0

I am presently working on an application which has an external dependency on micro-services, there are around 25 microservices, which are administrated via a eureka instance, every microservice has around 3-4 controllers.

This is an external dependency for me and blocks my work if it goes down, also I am unaware of the code ad logics for these microservices.

Currently, I am looking for a solution which can act as a simulator for these services in there absence, some application which can intercept and log, all the request and response to/from the external services, and in absence of these services it can match the last response to a requests from log and provide that response.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Vivek Gupta
  • 2,534
  • 3
  • 15
  • 28

1 Answers1

0

you should check mockito or any other mock framework just record and serialize the result e.g. with xstream and respond with the deserialized xstream result and modify it slightly by your needs.

This is the quickest solution for mocking remote services.

cilap
  • 2,215
  • 1
  • 25
  • 51
  • Thanks for the reply Cilap, I understand this could be done by storing response and serving them when required, but my preference would be if there is any library or application built specially for this purpose already? – Vivek Gupta May 08 '18 at 07:05
  • @VivekGupta I cannot assume there is a lib for such thing. Because the lib would be so generic that you can integrate any service type and any data type. What you can use is a restassured or similar for implementing a REST api test. But this is a test approach and not a mocking approach. Anyway I am curious if anyone knows such a lib, learning every day... – cilap May 11 '18 at 10:28