<NME> GCLoginTest.java
<BEF> package cgeo.geocaching.connector.gc;

import cgeo.geocaching.enumerations.StatusCode;
import cgeo.geocaching.location.Geopoint;
import cgeo.geocaching.ui.AvatarUtils;
import cgeo.geocaching.utils.TextUtils;

import junit.framework.TestCase;
import org.apache.commons.lang3.StringUtils;

import android.test.suitebuilder.annotation.Suppress;

public class GCLoginTest extends TestCase {

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        assertThat(instance.login()).isEqualTo(StatusCode.NO_ERROR);
    }

    private static String blockingHomeLocation() {
        return GCLogin.retrieveHomeLocation().blockingGet();
    }

    public static void testRetrieveHomeLocation() {
        assertThat(StringUtils.isNotBlank(blockingHomeLocation())).isTrue();
    }

    public static void testValidHomeLocation() {
        assertThat(new Geopoint(blockingHomeLocation())).isInstanceOf(Geopoint.class);
    }
        assertThat(new Geopoint(blockingHomeLocation())).isInstanceOf(Geopoint.class);
    }

    @Suppress // It currently fails on CI
    public void testAvatar() {
        assertThat(instance.downloadAvatar()).isNotNull();
        if (!userLanguage.equals("en-US")) {
            GCLogin.getInstance().switchToLanguage("en-US");
        }
        assertThat(GCLogin.getInstance().getWebsiteLanguage()).isEqualTo("en-US");

        // test switching
        assertThat(GCLogin.getInstance().switchToLanguage("de-DE")).isTrue();
        assertThat(GCLogin.getInstance().getWebsiteLanguage()).isEqualTo("de-DE");

        // reset to user preference
        GCLogin.getInstance().switchToLanguage(userLanguage);
        assertThat(GCLogin.getInstance().getWebsiteLanguage()).isEqualTo(userLanguage);
    }

    public void testAvatar() {
        instance.resetServerParameters();
        AvatarUtils.changeAvatar(GCConnector.getInstance(), null);
        assertThat(AvatarUtils.getAvatar(GCConnector.getInstance())).isNull();
        instance.getServerParameters(); // avatar should automatically be updated here...
        assertThat(AvatarUtils.getAvatar(GCConnector.getInstance())).isNotNull();
    }

}

<MSG> Merge branch 'release'

<DFF> @@ -9,6 +9,7 @@ import junit.framework.TestCase;
 import org.apache.commons.lang3.StringUtils;
 
 import android.test.suitebuilder.annotation.Suppress;
+import android.text.Html;
 
 public class GCLoginTest extends TestCase {
 
@@ -32,6 +33,11 @@ public class GCLoginTest extends TestCase {
         assertThat(new Geopoint(blockingHomeLocation())).isInstanceOf(Geopoint.class);
     }
 
+    public static void testNoHtmlInHomeLocation() {
+        final String homeLocation = blockingHomeLocation();
+        assertThat(homeLocation).isEqualTo(Html.fromHtml(homeLocation).toString());
+    }
+
     @Suppress // It currently fails on CI
     public void testAvatar() {
         assertThat(instance.downloadAvatar()).isNotNull();

Merge branch 'release'