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

import cgeo.geocaching.enumerations.StatusCode;
import cgeo.geocaching.location.Geopoint;
import cgeo.geocaching.enumerations.StatusCode;
import cgeo.geocaching.location.Geopoint;

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 {

    private final GCLogin instance = GCLogin.getInstance();
    protected void setUp() throws Exception {
        super.setUp();
        assertThat(instance.login()).isEqualTo(StatusCode.NO_ERROR);
    }

    }

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

    public static void testRetrieveHomeLocation() {

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

    public static void testNoHtmlInHomeLocation() {
        final String homeLocation = blockingHomeLocation();
        assertThat(homeLocation).isEqualTo(TextUtils.stripHtml(homeLocation));
    }

    public static void testLanguageSwitch() {
        final String userLanguage = GCLogin.getInstance().getWebsiteLanguage();
        assertThat(userLanguage).isNotNull();

        // make sure language is set to english
        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> Migrate network code to RxJava 2

<DFF> @@ -5,12 +5,12 @@ import static org.assertj.core.api.Assertions.assertThat;
 import cgeo.geocaching.enumerations.StatusCode;
 import cgeo.geocaching.location.Geopoint;
 
-import junit.framework.TestCase;
-import org.apache.commons.lang3.StringUtils;
-
 import android.test.suitebuilder.annotation.Suppress;
 import android.text.Html;
 
+import junit.framework.TestCase;
+import org.apache.commons.lang3.StringUtils;
+
 public class GCLoginTest extends TestCase {
 
     private final GCLogin instance = GCLogin.getInstance();
@@ -22,7 +22,7 @@ public class GCLoginTest extends TestCase {
     }
 
     private static String blockingHomeLocation() {
-        return GCLogin.retrieveHomeLocation().toBlocking().value();
+        return GCLogin.retrieveHomeLocation().blockingGet();
     }
 
     public static void testRetrieveHomeLocation() {

Migrate network code to RxJava 2