Skip to content

Commit 7d71b2e

Browse files
committed
Make tests more explicit
1 parent c1cd197 commit 7d71b2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ public void testSignUpAsyncWithMergeInDiskAnonymousUser() throws Exception {
218218
ParseUser currentUser = mock(ParseUser.class);
219219
when(currentUser.getUsername()).thenReturn("oldUserName");
220220
when(currentUser.getPassword()).thenReturn("oldPassword");
221+
when(currentUser.isLazy()).thenReturn(false);
221222
when(currentUser.isLinked(ParseAnonymousUtils.AUTH_TYPE)).thenReturn(true);
222223
when(currentUser.getSessionToken()).thenReturn("oldSessionToken");
223224
when(currentUser.getAuthData()).thenReturn(new HashMap<String, Map<String, String>>());
@@ -264,11 +265,11 @@ public void testSignUpAsyncWithMergeInDiskAnonymousUserSaveFailure() throws Exce
264265
Map<String, String> oldAnonymousAuthData = new HashMap<>();
265266
oldAnonymousAuthData.put("oldKey", "oldToken");
266267
currentUser.putAuthData(ParseAnonymousUtils.AUTH_TYPE, oldAnonymousAuthData);
267-
ParseUser partialMockCurrentUser = spy(currentUser);
268-
when(partialMockCurrentUser.getObjectId()).thenReturn("oldObjectId");
268+
ParseUser partialMockCurrentUser = spy(currentUser); // Spy since we need mutex
269269
when(partialMockCurrentUser.getUsername()).thenReturn("oldUserName");
270270
when(partialMockCurrentUser.getPassword()).thenReturn("oldPassword");
271271
when(partialMockCurrentUser.getSessionToken()).thenReturn("oldSessionToken");
272+
when(partialMockCurrentUser.isLazy()).thenReturn(false);
272273
ParseException saveException = new ParseException(ParseException.OTHER_CAUSE, "");
273274
doReturn(Task.<Void>forError(saveException))
274275
.when(partialMockCurrentUser)

0 commit comments

Comments
 (0)