UrlAllowList { public boolean addEntry(@NonNull String pattern) { return addEntry(pattern, SCOPE_ALL); }  boolean addEntry(@NonNull String pattern); boolean addEntry(@NonNull String pattern, @Scope int scope); boolean isAllowed(@Nullable String url); boolean isAllowed(@Nullable String url, @Scope int scope); @NonNull static UrlAllowList createDefaultUrlAllowList(@NonNull AirshipConfigOptions airshipConfigOptions); void setUrlAllowListCallback(@Nullable OnUrlAllowListCallback urlAllowListCallback); static final int SCOPE_JAVASCRIPT_INTERFACE; static final int SCOPE_OPEN_URL; static final int SCOPE_ALL; }
@Test public void testInvalidPatterns() { assertFalse(urlAllowList.addEntry("not a url")); assertFalse(urlAllowList.addEntry(null)); assertFalse(urlAllowList.addEntry("*:*")); assertFalse(urlAllowList.addEntry("www.urbanairship.com")); assertFalse(urlAllowList.addEntry(": assertFalse(urlAllowList.addEntry(" file: assertFalse(urlAllowList.addEntry("*: assertFalse(urlAllowList.addEntry("*: assertFalse(urlAllowList.addEntry("*: assertFalse(urlAllowList.addEntry("file: }