Improved unit tests for RestClient.