@Test public void testRetryLogic() throws Exception { ParseHttpClient mockHttpClient = mock(ParseHttpClient.class); when(mockHttpClient.execute(any(ParseHttpRequest.class))).thenThrow(new IOException()); TestParseRequest request = new TestParseRequest(ParseHttpRequest.Method.GET, "http: Task<String> task = request.executeAsync(mockHttpClient); task.waitForCompletion(); verify(mockHttpClient, times(5)).execute(any(ParseHttpRequest.class)); }
public Task<Response> executeAsync(final ParseHttpClient client) { return executeAsync(client, (ProgressCallback) null, null, null); }
ParseRequest { public Task<Response> executeAsync(final ParseHttpClient client) { return executeAsync(client, (ProgressCallback) null, null, null); } }
ParseRequest { public Task<Response> executeAsync(final ParseHttpClient client) { return executeAsync(client, (ProgressCallback) null, null, null); } ParseRequest(String url);  ParseRequest(ParseHttpRequest.Method method, String url); }
ParseRequest { public Task<Response> executeAsync(final ParseHttpClient client) { return executeAsync(client, (ProgressCallback) null, null, null); } ParseRequest(String url);  ParseRequest(ParseHttpRequest.Method method, String url); static long getDefaultInitialRetryDelay(); static void setDefaultInitialRetryDelay(long delay); Task<Response> executeAsync(final ParseHttpClient client); Task<Response> executeAsync(final ParseHttpClient client, Task<Void> cancellationToken); Task<Response> executeAsync(
            final ParseHttpClient client,
            final ProgressCallback uploadProgressCallback,
            final ProgressCallback downloadProgressCallback); Task<Response> executeAsync(
            final ParseHttpClient client,
            final ProgressCallback uploadProgressCallback,
            final ProgressCallback downloadProgressCallback,
            Task<Void> cancellationToken); }
ParseRequest { public Task<Response> executeAsync(final ParseHttpClient client) { return executeAsync(client, (ProgressCallback) null, null, null); } ParseRequest(String url);  ParseRequest(ParseHttpRequest.Method method, String url); static long getDefaultInitialRetryDelay(); static void setDefaultInitialRetryDelay(long delay); Task<Response> executeAsync(final ParseHttpClient client); Task<Response> executeAsync(final ParseHttpClient client, Task<Void> cancellationToken); Task<Response> executeAsync(
            final ParseHttpClient client,
            final ProgressCallback uploadProgressCallback,
            final ProgressCallback downloadProgressCallback); Task<Response> executeAsync(
            final ParseHttpClient client,
            final ProgressCallback uploadProgressCallback,
            final ProgressCallback downloadProgressCallback,
            Task<Void> cancellationToken);  }