title: What are ways to unit test Rest API clients - i.e. testing that the right Rest requests are sent
body: <p>At work we're developing a service that sits between two other services. We expose a Rest API which is called by some service -- the request is processed by some logic and then, according to the logic, HTTP requests will be sent out another service.</p>
  
  <p>There're plenty of resources on the internet on how to best test API endpoints you provide. I, on the other hand want to test what API requests are sent out, without sending them to the actual service.</p>
  
  <p>I guess I could always set up an entire server skeleton on localhost:8080 that just records what it receives but this feels kinda dirty. Testing the Rest API we provide for external services (we use akka-http to do that) is pretty comfortable to test with akka-http-testkit which is excellent. I was just wondering if there is any comparably comfortable to use tooling to test what Http reqeusts go out.</p>