Skip to content

Commit 5b39f71

Browse files
committed
Fix unit test
1 parent 5719cad commit 5b39f71

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

sdk/mobile-center-distribute/src/test/java/com/microsoft/azure/mobile/distribute/DistributeMandatoryDownloadTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,17 @@ public Void answer(InvocationOnMock invocation) throws Throwable {
291291
}).when(mContext).startActivity(installIntent);
292292
doAnswer(new Answer<Void>() {
293293

294+
boolean firstCall = true;
295+
294296
@Override
295297
public Void answer(InvocationOnMock invocation) throws Throwable {
296-
beforeStartingActivityLock.release();
297-
disabledLock.acquireUninterruptibly();
298+
299+
/* First call is update progress dialog, second is hide. */
300+
if (firstCall) {
301+
firstCall = false;
302+
beforeStartingActivityLock.release();
303+
disabledLock.acquireUninterruptibly();
304+
}
298305
(((Runnable) invocation.getArguments()[0])).run();
299306
return null;
300307
}

0 commit comments

Comments
 (0)