I currently have a script that continuously polls a Google API - I have integrated error handling, and would like to test that the expected behavior ensues when receiving such errors.
I would like to know how to create mock GoogleJsonResponseExceptions - specifically 403 to test my exponential backoff, I saw that there is an HttpResponseException builder - http://javadoc.google-http-java-client.googlecode.com/hg/1.19.0/com/google/api/client/http/HttpResponseException.Builder.html
But I need to create exceptions of type GoogleJsonResponseException. I can mock things such as 401 (invalid credentials), but 403 is a little harder to do?
Please help, thanks!