WikiSite implements Parcelable { @NonNull public String mobileAuthority() { return authorityToMobile(authority()); } WikiSite(@NonNull Uri uri);  WikiSite(@NonNull String url);  WikiSite(@NonNull String authority, @NonNull String languageCode); protected  WikiSite(@NonNull Parcel in); static boolean supportedAuthority(@NonNull String authority); static void setDefaultBaseUrl(@NonNull String url); static WikiSite forLanguageCode(@NonNull String languageCode); @NonNull String scheme(); @NonNull String authority(); @NonNull String mobileAuthority(); String mobileUrl(); @NonNull String desktopAuthority(); @NonNull String subdomain(); @NonNull String path(@NonNull String segment); @NonNull Uri uri(); @NonNull String url(); @NonNull String url(@NonNull String segment); @NonNull String languageCode(); PageTitle titleForInternalLink(String internalLink); PageTitle titleForUri(Uri uri); @NonNull String dbName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override int describeContents(); @Override void writeToParcel(@NonNull Parcel dest, int flags); static final String DEFAULT_SCHEME; static final Parcelable.Creator<WikiSite> CREATOR; }
@Test public void testMobileAuthorityNoLanguage() { WikiSite subject = new WikiSite("wikipedia.org"); assertThat(subject.mobileAuthority(), is("m.wikipedia.org")); }
@Test public void testMobileAuthorityLanguageAuthority() { WikiSite subject = new WikiSite("no.wikipedia.org", "nb"); assertThat(subject.mobileAuthority(), is("no.m.wikipedia.org")); }
@Test public void testMobileAuthorityMobileAuthority() { WikiSite subject = new WikiSite("ru.m.wikipedia.org"); assertThat(subject.mobileAuthority(), is("ru.m.wikipedia.org")); }
@Test public void testMobileAuthorityMobileAuthorityNoLanguage() { WikiSite subject = new WikiSite("m.wikipedia.org"); assertThat(subject.mobileAuthority(), is("m.wikipedia.org")); }