@Beta public class MockHttpUnsuccessfulResponseHandler extends Objectimplements HttpUnsuccessfulResponseHandler
Beta
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 and Description |
|---|
MockHttpUnsuccessfulResponseHandler(boolean successfullyHandleResponse)
Create an instance of
MockHttpUnsuccessfulResponseHandler.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
handleResponse(HttpRequest
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.
|
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)
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(HttpRequestrequest, HttpResponse response, boolean supportsRetry) throws IOException
HttpUnsuccessfulResponseHandler
handleResponse in interface
HttpUnsuccessfulResponseHandler
request - Request object that can be read from for context or modified before retry
response - Response to process
supportsRetry - 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