I'm using nock (
https://github.com/pgte/nock ) to mock the API calls for unit testing.
I start by recording the API calls from my unit test:
var nock = require('nock');
nock.recorder.rec();
You'll get something like this dumped to the console:
nock('
https://maps.googleapis.com:443')
.get('/maps/api/timezone/json?location=43.647%2C-79.39275×tamp=1414368000')
.reply(200, {"dstOffset":3600,"rawOffset":-18000,"status":"OK","timeZoneId":"America/Toronto","timeZoneName":"Eastern Daylight Time"});
Copy that into your unit test and it will fake the API call such that you can test that the call was made correctly from your rest connector without hitting the API.
~ Bryan