Source:
public void testScenario_LoginHint_IdToken_Different() throws InterruptedException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InstantiationException, InvocationTargetException, NoSuchAlgorithmException, NoSuchPaddingException, UnsupportedEncodingException { FileMockContext mockContext = new FileMockContext(getContext()); final AuthenticationContext context = new AuthenticationContext(mockContext, VALID_AUTHORITY, false); context.getCache().removeAll(); setConnectionAvailable(context, true); final CountDownLatch signal = new CountDownLatch(1); final CountDownLatch signalCallback = new CountDownLatch(1); final MockActivity testActivity = new MockActivity(signal); MockAuthenticationCallback callback = new MockAuthenticationCallback(signalCallback); MockWebRequestHandler webrequest = new MockWebRequestHandler(); IdToken idtoken = new IdToken(); idtoken.upn = "admin@user.com"; idtoken.oid = "admin123"; String loginHint = "user1@user.com"; String json = "{\"id_token\":\"" + idtoken.getIdToken() + "\",\"access_token\":\"TokenUserIdTest\",\"token_type\":\"Bearer\",\"expires_in\":\"28799\",\"expires_on\":\"1368768616\",\"refresh_token\":\"refresh112\",\"scope\":\"*\"}"; webrequest.setReturnResponse(new HttpWebResponse(200, json.getBytes(Charset .defaultCharset()), null)); ReflectionUtils.setFieldValue(context, "mWebRequest", webrequest); Intent intent = getResponseIntent(callback, "resource", "clientid", "redirectUri", loginHint); tokenWithAuthenticationActivity(context, testActivity, signal, signalCallback, intent, "resource", "clientid", "redirectUri", loginHint, callback); verifyTokenResult(idtoken, callback.mResult); final CountDownLatch signalCallback2 = new CountDownLatch(1); callback.mSignal = signalCallback2; context.acquireToken(testActivity, "resource", "clientid", "redirectUri", idtoken.upn, callback); signalCallback2.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); verifyTokenResult(idtoken, callback.mResult); AuthenticationResult result = context.acquireTokenSilentSync("resource", "clientid", idtoken.oid); verifyTokenResult(idtoken, result); clearCache(context); }

Target:
public void testScenario_LoginHint_IdToken_Different() throws InterruptedException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InstantiationException, InvocationTargetException, NoSuchAlgorithmException, NoSuchPaddingException, UnsupportedEncodingException, AuthenticationException { FileMockContext mockContext = new FileMockContext(getContext()); final AuthenticationContext context = new AuthenticationContext(mockContext, VALID_AUTHORITY, false); context.getCache().removeAll(); setConnectionAvailable(context, true); final CountDownLatch signal = new CountDownLatch(1); final CountDownLatch signalCallback = new CountDownLatch(1); final MockActivity testActivity = new MockActivity(signal); MockAuthenticationCallback callback = new MockAuthenticationCallback(signalCallback); MockWebRequestHandler webrequest = new MockWebRequestHandler(); IdToken idtoken = new IdToken(); idtoken.upn = "admin@user.com"; idtoken.oid = "admin123"; String loginHint = "user1@user.com"; String json = "{\"id_token\":\"" + idtoken.getIdToken() + "\",\"access_token\":\"TokenUserIdTest\",\"token_type\":\"Bearer\",\"expires_in\":\"28799\",\"expires_on\":\"1368768616\",\"refresh_token\":\"refresh112\",\"scope\":\"*\"}"; webrequest.setReturnResponse(new HttpWebResponse(200, json.getBytes(Charset .defaultCharset()), null)); ReflectionUtils.setFieldValue(context, "mWebRequest", webrequest); Intent intent = getResponseIntent(callback, "resource", "clientid", "redirectUri", loginHint); tokenWithAuthenticationActivity(context, testActivity, signal, signalCallback, intent, "resource", "clientid", "redirectUri", loginHint, callback); verifyTokenResult(idtoken, callback.mResult); final CountDownLatch signalCallback2 = new CountDownLatch(1); callback.mSignal = signalCallback2; context.acquireToken(testActivity, "resource", "clientid", "redirectUri", idtoken.upn, callback); signalCallback2.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); verifyTokenResult(idtoken, callback.mResult); AuthenticationResult result = context.acquireTokenSilentSync("resource", "clientid", idtoken.oid); verifyTokenResult(idtoken, result); clearCache(context); }