You can trace your application's system calls with truss/trace/strace/... (the name, command line syntax and output format is OS-dependent), and watch for connect calls. If your application also uses non-HTTP networking you may have to work a little harder to filter the relevant connections.
You can use LD_PRELOAD or a debugger to modify the function that creates the HTTP connections. But this may be too intrusive for a test.
You can put a simple proxy between your application and the web. Both perl and python come with libraries that would make it a 10–20-line program. This is the approach I'd prefer unless you're specifically testing your application's behavior against a specific server or proxy.