UrlAllowList { public boolean isAllowed(@Nullable String url) { return isAllowed(url, 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 testEmptyUrlAllowList() { assertFalse(urlAllowList.isAllowed(null, UrlAllowList.SCOPE_JAVASCRIPT_INTERFACE)); assertFalse(urlAllowList.isAllowed("", UrlAllowList.SCOPE_OPEN_URL)); assertFalse(urlAllowList.isAllowed("urbanairship.com", UrlAllowList.SCOPE_JAVASCRIPT_INTERFACE)); assertFalse(urlAllowList.isAllowed("www.urbanairship.com", UrlAllowList.SCOPE_OPEN_URL)); assertFalse(urlAllowList.isAllowed("http: assertFalse(urlAllowList.isAllowed("https: assertFalse(urlAllowList.isAllowed("http: assertFalse(urlAllowList.isAllowed("file: }