We need to extend pretty old application, which make a lot of integration testing connected with remote datasources, but this cases wasn't properly writtten, so it's not an easy way to change it to some network independent stubs. Is it possible to create some kind of a script for unix, who will be listen for specific requests, let's say to google.com/api/123
and if such request found, not allow it to go forward, but return some value, which we previously mapped on that url?
Asked
Active
Viewed 210 times
0

silent_coder
- 6,222
- 14
- 47
- 91
1 Answers
1
You most likely need to set up a proxy server like Squid, set up redirection and route all traffic through that proxy.

McMonster
- 171
- 1
- 10
-
Thanks, But I think it's a programm mostly for manual usage, or is it possible to write some config, like "when traked request to that URL, than return that JSON"? – silent_coder Jul 22 '14 at 14:13
-
You don't need any manual interaction with squid, you just configure proper rules, redirect the traffic through it and everything happens automatically. It may be complicated to use at first glance, but this would be a stable, elegant solution to your problem. – McMonster Jul 22 '14 at 14:17