Skip to content

Commit 441aab8

Browse files
committed
Combine unit test cases
1 parent 600c8bc commit 441aab8

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

Parse/src/test/java/com/parse/ParseFileControllerTest.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -303,32 +303,6 @@ public void testFetchAsyncSuccess() throws Exception {
303303

304304
ParseHttpClient awsClient = mock(ParseHttpClient.class);
305305
when(awsClient.execute(any(ParseHttpRequest.class))).thenReturn(mockResponse);
306-
File root = temporaryFolder.getRoot();
307-
ParseFileController controller = new ParseFileController(null, root).awsClient(awsClient);
308-
309-
ParseFile.State state = new ParseFile.State.Builder()
310-
.name("file_name")
311-
.url("url")
312-
.build();
313-
Task<File> task = controller.fetchAsync(state, null, null, null);
314-
File result = ParseTaskUtils.wait(task);
315-
316-
verify(awsClient, times(1)).execute(any(ParseHttpRequest.class));
317-
assertTrue(result.exists());
318-
assertEquals("hello", ParseFileUtils.readFileToString(result, "UTF-8"));
319-
assertFalse(controller.getTempFile(state).exists());
320-
}
321-
322-
@Test
323-
public void testFetchAsyncSuccessWithCacheDirNotExist() throws Exception {
324-
byte[] data = "hello".getBytes();
325-
ParseHttpResponse response = mock(ParseHttpResponse.class);
326-
when(response.getStatusCode()).thenReturn(200);
327-
when(response.getContent()).thenReturn(new ByteArrayInputStream(data));
328-
when(response.getTotalSize()).thenReturn((long) data.length);
329-
330-
ParseHttpClient awsClient = mock(ParseHttpClient.class);
331-
when(awsClient.execute(any(ParseHttpRequest.class))).thenReturn(response);
332306
// Make sure cache dir does not exist
333307
File root = new File(temporaryFolder.getRoot(), "cache");
334308
assertFalse(root.exists());

0 commit comments

Comments
 (0)