Skip to content

Commit d6bf4a8

Browse files
committed
fix test
1 parent c380714 commit d6bf4a8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

common/src/test/java/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClientTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,14 @@ public void setup() {
9898
final AuthorizationActivity activity = mock(AuthorizationActivity.class);
9999
final WebViewAuthorizationFragment fragment = mock(WebViewAuthorizationFragment.class);
100100
final Context context = ApplicationProvider.getApplicationContext();
101+
final HashMap<String,String> params = new HashMap<>();
102+
params.put(AuthenticationConstants.OAuth2.REDIRECT_URI, TEST_REDIRECT_URI);
103+
params.put(AuthenticationConstants.SWITCH_BROWSER.CODE, SWITCH_BROWSER_CODE);
104+
when(activity.getIntent()).thenReturn(null);
101105
when(activity.getApplicationContext()).thenReturn(context);
102106
when(activity.getFragment()).thenReturn(fragment);
103107
when(activity.getPackageManager()).thenReturn(context.getPackageManager());
108+
when(fragment.constructSwithBrowserUri(SWITCH_BROWSER_ACTION_URI + SWITCH_BROWSER_ACTION_URI_PATHS, params)).thenReturn(Uri.parse(TEST_SWITCH_BROWSER_URL));
104109
when(fragment.launchWebBrowserIntent(Uri.parse(TEST_SWITCH_BROWSER_URL))).thenReturn(true);
105110
mMockWebView = new WebView(context);
106111
mWebViewClient = new AzureActiveDirectoryWebViewClient(

0 commit comments

Comments
 (0)