Skip to content

Commit

Permalink
fix: ParseFileTest.testSaveAsyncSuccessWithUri
Browse files Browse the repository at this point in the history
  • Loading branch information
abubkr-hago committed Aug 19, 2024
1 parent 6865aec commit fdce770
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions parse/src/test/java/com/parse/ParseFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public void testSaveAsyncSuccessWithUri() throws Exception {
ParseFileController controller = mock(ParseFileController.class);
when(controller.saveAsync(
any(ParseFile.State.class),
any(File.class),
any(Uri.class),
nullable(String.class),
nullable(ProgressCallback.class),
nullable(Task.class)))
Expand All @@ -278,18 +278,20 @@ public void testSaveAsyncSuccessWithUri() throws Exception {
// Verify controller get the correct data
ArgumentCaptor<ParseFile.State> stateCaptor =
ArgumentCaptor.forClass(ParseFile.State.class);
ArgumentCaptor<File> fileCaptor = ArgumentCaptor.forClass(File.class);
ArgumentCaptor<Uri> uriCaptor = ArgumentCaptor.forClass(Uri.class);
verify(controller, times(1))
.saveAsync(
stateCaptor.capture(),
fileCaptor.capture(),
uriCaptor.capture(),
nullable(String.class),
nullable(ProgressCallback.class),
nullable(Task.class));
assertNull(stateCaptor.getValue().url());
assertEquals(name, stateCaptor.getValue().name());
assertEquals(contentType, stateCaptor.getValue().mimeType());
assertEquals(file, fileCaptor.getValue());
assertEquals(
"file://".concat(file.getAbsolutePath()),
Uri.decode(uriCaptor.getValue().toString()));
// Verify the state of ParseFile has been updated
assertEquals(url, parseFile.getUrl());
}
Expand Down

0 comments on commit fdce770

Please sign in to comment.