Code example for ResolveInfo

0
    public void shouldOverrideUrlLoading_withValidMarketIntent_withUserClick_shouldOpenPlayStore() throws Exception { 
        stub(htmlWebView.hasUserClicked()).toReturn(true);
 
        subject = new HtmlWebViewClient(htmlWebViewListener, htmlWebView, null, null);
        String validMarketUrl = "market://somethingValid";
        Robolectric.packageManager.addResolveInfoForIntent(new Intent(Intent.ACTION_VIEW, Uri.parse(validMarketUrl)), new ResolveInfo());
        boolean didOverrideUrl = subject.shouldOverrideUrlLoading(htmlWebView, validMarketUrl);
 
        assertThat(didOverrideUrl).isTrue();
        verify(htmlWebViewListener).onClicked();
 
        Intent startedActivity = assertActivityStarted();
        assertThat(startedActivity.getAction()).isEqualTo(Intent.ACTION_VIEW);
        assertThat(startedActivity.getData().toString()).isEqualTo(validMarketUrl);
    } 
 
    @Test 
    public void shouldOverrideUrlLoading_withValidMarketIntent_withoutUserClick_shouldNotOpenPlayStore() throws Exception { 
        stub(htmlWebView.hasUserClicked()).toReturn(false);
 
Connect your IDE to all the code out there  Get Codota for Java