|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.client.testing.http.MockHttpUnsuccessfulResponseHandler
public class MockHttpUnsuccessfulResponseHandler
Mock for HttpUnsuccessfulResponseHandler.
Contains an isCalled method that returns true if handleResponse(com.google.api.client.http.HttpRequest, com.google.api.client.http.HttpResponse, boolean) is called.
| Constructor Summary | |
|---|---|
MockHttpUnsuccessfulResponseHandler(boolean successfullyHandleResponse)
Create an instance of MockHttpUnsuccessfulResponseHandler. |
|
| Method Summary | |
|---|---|
boolean |
handleResponse(HttpRequest request,
HttpResponse response,
boolean supportsRetry)
Handler that will be invoked when an abnormal response is received. |
boolean |
isCalled()
Returns whether the handleResponse(com.google.api.client.http.HttpRequest, com.google.api.client.http.HttpResponse, boolean) method was called or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockHttpUnsuccessfulResponseHandler(boolean successfullyHandleResponse)
MockHttpUnsuccessfulResponseHandler.
successfullyHandleResponse - This will be the return value of handleResponse(com.google.api.client.http.HttpRequest, com.google.api.client.http.HttpResponse, boolean)| Method Detail |
|---|
public boolean isCalled()
handleResponse(com.google.api.client.http.HttpRequest, com.google.api.client.http.HttpResponse, boolean) method was called or not.
public boolean handleResponse(HttpRequest request,
HttpResponse response,
boolean supportsRetry)
throws IOException
HttpUnsuccessfulResponseHandler
handleResponse in interface HttpUnsuccessfulResponseHandlerrequest - Request object that can be read from for context or modified before retryresponse - Response to processsupportsRetry - Whether there will actually be a retry if this handler return true. Some handlers may want to have an effect only when there will actually be a retry
after they handle their event (e.g. a handler that implements exponential backoff).
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||