Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(response),
Util.createInputStream(response2));
Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK);
context.acquireToken(testActivity, "resource", "clientid", "redirectUri",
TEST_IDTOKEN_UPN, callback);
<BUG>signal.await(CONTEXT_REQUEST_TIME_OUT*1000, TimeUnit.MILLISECONDS);
verifyRefreshTokenResponse(mockCache, callback.mException, callback.mResult);</BUG>
AuthenticationResult result = context.acquireTokenSilentSync("resource", "clientid",
TEST_IDTOKEN_USERID);
assertEquals("Access Token", "TokenReturnsWithIdToken", result.getAccessToken());

Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(response),
Util.createInputStream(response2));
Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK);
context.acquireToken(testActivity, "resource", "clientid", "redirectUri",
TEST_IDTOKEN_UPN, callback);
signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS);
verifyRefreshTokenResponse(mockCache, callback.mException, callback.mResult);
AuthenticationResult result = context.acquireTokenSilentSync("resource", "clientid",
TEST_IDTOKEN_USERID);
assertEquals("Access Token", "TokenReturnsWithIdToken", result.getAccessToken());
