I have a bunch of microservices written using Java and Spring Boot 2.
generation-service, creates an object with a bunch of info and sends it to the next service (in the body of a request pointing to the next service endpoint) that we'll call receiver-service.
Now, I want to test the object generated by generation-service.
Is there any way that I can intercept the request created by generation service and redirect it to a test object? (Spawning a service and pointing generation-service to this endpoint is not an option as I cannot spawn new services.)
Please notice that the post "How to mock RestTemplate in Java Spring?" doesn't solve my problem as I am not interested in testing the response, but the request to the next service. With Rest template I can instead check just the feed that is just OK/FAILED.