Source:
<code>public void testFavorLocalCacheUseLocalRTSucceeds() <START> throws PackageManager.NameNotFoundException, OperationCanceledException, <END> IOException, AuthenticatorException, InterruptedException, NoSuchAlgorithmException { final Calendar expiredTime = new GregorianCalendar(); expiredTime.add(Calendar.MINUTE, -MINUS_MINUITE); final ITokenCacheStore cacheStore = getTokenCache(expiredTime.getTime(), false, false); final AccountManager mockedAccountManager = getMockedAccountManager(); mockAccountManagerGetAccountBehavior(mockedAccountManager); mockGetAuthTokenCall(mockedAccountManager, true); final FileMockContext mockContext = createMockContext(); mockContext.setMockedAccountManager(mockedAccountManager); prepareSuccessHttpUrlConnection(); prepareAuthForBrokerCall(); final AuthenticationContext authContext = new AuthenticationContext(mockContext, VALID_AUTHORITY, false, cacheStore); final TestAuthCallback callback = new TestAuthCallback(); authContext.acquireTokenSilentAsync("resource", "clientid", TEST_USERID, callback); final CountDownLatch signal = new CountDownLatch(1); signal.await(ACTIVITY_TIME_OUT, TimeUnit.MILLISECONDS); verify(mockedAccountManager, times(0)).getAuthToken(Mockito.any(Account.class), Matchers.anyString(), Matchers.any(Bundle.class), Matchers.eq(false), (AccountManagerCallback<Bundle>) Matchers.eq(null), Matchers.any(Handler.class)); assertNull(callback.getCallbackException()); assertNotNull(callback.getCallbackResult()); assertTrue(callback.getCallbackResult().getAccessToken().equals("I am a new access token")); assertTrue(cacheStore.getAll().hasNext()); cacheStore.removeAll(); }</code><technical_language>changing this</technical_language>

Target:
public void testFavorLocalCacheUseLocalRTSucceeds() throws PackageManager.NameNotFoundException, OperationCanceledException, IOException, AuthenticatorException, InterruptedException { final ITokenCacheStore cacheStore = getTokenCache(getExpireDate(-MINUS_MINUITE), false, false, null); final AccountManager mockedAccountManager = getMockedAccountManager(); mockAccountManagerGetAccountBehavior(mockedAccountManager); mockGetAuthTokenCall(mockedAccountManager, true); final FileMockContext mockContext = createMockContext(); mockContext.setMockedAccountManager(mockedAccountManager); prepareSuccessHttpUrlConnection(); prepareAuthForBrokerCall(); final AuthenticationContext authContext = new AuthenticationContext(mockContext, VALID_AUTHORITY, false, cacheStore); final TestAuthCallback callback = new TestAuthCallback(); authContext.acquireTokenSilentAsync("resource", "clientid", TEST_USERID, callback); final CountDownLatch signal = new CountDownLatch(1); signal.await(ACTIVITY_TIME_OUT, TimeUnit.MILLISECONDS); verify(mockedAccountManager, times(0)).getAuthToken(Mockito.any(Account.class), Matchers.anyString(), Matchers.any(Bundle.class), Matchers.eq(false), (AccountManagerCallback<Bundle>) Matchers.eq(null), Matchers.any(Handler.class)); assertNull(callback.getCallbackException()); assertNotNull(callback.getCallbackResult()); assertTrue(callback.getCallbackResult().getAccessToken().equals("I am a new access token")); assertTrue(cacheStore.getAll().hasNext()); cacheStore.removeAll(); }