Map<String, String> authData = new HashMap<>();
authData.put("token", "test");
ParseTaskUtils.wait(partialMockUser.linkWithAsync(authType, authData, "sessionTokenAgain"));
assertNull(partialMockUser.getAuthData().get(ParseAnonymousUtils.AUTH_TYPE));
assertSame(authData, partialMockUser.getAuthData().get("facebook"));
<BUG>verify(partialMockUser, times(1)).saveAsync(eq("sessionTokenAgain"), Matchers.<Task<Void>>any());
verify(provider, times(1)).restoreAuthentication(authData);</BUG>
}
@Test
public void testLinkWithAsyncWithSaveAsyncFailure() throws Exception {

Map<String, String> authData = new HashMap<>();
authData.put("token", "test");
ParseTaskUtils.wait(partialMockUser.linkWithAsync(authType, authData, "sessionTokenAgain"));
assertNull(partialMockUser.getAuthData().get(ParseAnonymousUtils.AUTH_TYPE));
assertSame(authData, partialMockUser.getAuthData().get("facebook"));
verify(partialMockUser, times(1))
.saveAsync(eq("sessionTokenAgain"), eq(false), Matchers.<Task<Void>>any());
verify(provider, times(1)).restoreAuthentication(authData);
}
@Test
public void testLinkWithAsyncWithSaveAsyncFailure() throws Exception {
