@Test public void createIntentForBrowserSwitchActivityQuery_configuresAndReturnsIntent() { when(context.getApplicationContext()).thenReturn(applicationContext); when(applicationContext.getPackageName()).thenReturn("sample.package.name"); String returnUrlScheme = "sample.package.name.browserswitch"; Intent result = sut.createIntentForBrowserSwitchActivityQuery(returnUrlScheme); assertEquals(result.getData().toString(), "sample.package.name.browserswitch: assertEquals(result.getAction(), Intent.ACTION_VIEW); assertTrue(result.hasCategory(Intent.CATEGORY_DEFAULT)); assertTrue(result.hasCategory(Intent.CATEGORY_BROWSABLE)); }
Intent createIntentForBrowserSwitchActivityQuery(String returnUrlScheme) { String browserSwitchUrl = String.format("%s: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(browserSwitchUrl)); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.addCategory(Intent.CATEGORY_BROWSABLE); return intent; }
BrowserSwitchConfig { Intent createIntentForBrowserSwitchActivityQuery(String returnUrlScheme) { String browserSwitchUrl = String.format("%s: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(browserSwitchUrl)); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.addCategory(Intent.CATEGORY_BROWSABLE); return intent; } }
BrowserSwitchConfig { Intent createIntentForBrowserSwitchActivityQuery(String returnUrlScheme) { String browserSwitchUrl = String.format("%s: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(browserSwitchUrl)); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.addCategory(Intent.CATEGORY_BROWSABLE); return intent; }  }
BrowserSwitchConfig { Intent createIntentForBrowserSwitchActivityQuery(String returnUrlScheme) { String browserSwitchUrl = String.format("%s: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(browserSwitchUrl)); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.addCategory(Intent.CATEGORY_BROWSABLE); return intent; }   }
BrowserSwitchConfig { Intent createIntentForBrowserSwitchActivityQuery(String returnUrlScheme) { String browserSwitchUrl = String.format("%s: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(browserSwitchUrl)); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.addCategory(Intent.CATEGORY_BROWSABLE); return intent; }    }