### Question:
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 void setDefaultInitialRetryDelay(long delay); static long getDefaultInitialRetryDelay(); 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);  }### Answer:
@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)); }
@Test public void testDownloadProgress() throws Exception { ParseHttpResponse mockResponse = new ParseHttpResponse.Builder() .setStatusCode(200) .setTotalSize((long) data.length) .setContent(new ByteArrayInputStream(data)) .build(); ParseHttpClient mockHttpClient = mock(ParseHttpClient.class); when(mockHttpClient.execute(any(ParseHttpRequest.class))).thenReturn(mockResponse); File tempFile = temporaryFolder.newFile("test"); ParseFileRequest request = new ParseFileRequest(ParseHttpRequest.Method.GET, "localhost", tempFile); TestProgressCallback downloadProgressCallback = new TestProgressCallback(); Task<Void> task = request.executeAsync(mockHttpClient, null, downloadProgressCallback); task.waitForCompletion(); assertFalse("Download failed: " + task.getError(), task.isFaulted()); assertEquals(data.length, ParseFileUtils.readFileToByteArray(tempFile).length); assertProgressCompletedSuccessfully(downloadProgressCallback); }