package cgeo.geocaching.connector.gc;

import static org.assertj.core.api.Assertions.assertThat;

import cgeo.geocaching.enumerations.StatusCode;

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

import android.test.suitebuilder.annotation.Suppress;

public class GCLoginTest extends TestCase {

    final GCLogin instance = GCLogin.getInstance();

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

    public static void testHomeLocation() {
        assertThat(StringUtils.isNotBlank(GCLogin.retrieveHomeLocation().toBlocking().value())).isTrue();
    }

    @Suppress // It currently fails on CI
    public void testAvatar() {
        assertThat(instance.downloadAvatar()).isNotNull();
    }

}

@@ -138,16 +138,58 @@
 tusCode;
+%0Aimport cgeo.geocaching.location.Geopoint;
 %0A%0Aimport
@@ -365,16 +365,24 @@
  %7B%0A%0A    
+private 
 final GC
@@ -577,24 +577,150 @@
 OR);%0A    %7D%0A%0A
+    private static String blockingHomeLocation() %7B%0A        return GCLogin.retrieveHomeLocation().toBlocking().value();%0A    %7D%0A%0A
     public s
@@ -734,16 +734,24 @@
 oid test
+Retrieve
 HomeLoca
@@ -805,69 +805,183 @@
 ank(
-GCLogin.retrieveHomeLocation().toBlocking().value())).isTrue(
+blockingHomeLocation())).isTrue();%0A    %7D%0A%0A    public static void testValidHomeLocation() %7B%0A        assertThat(new Geopoint(blockingHomeLocation())).isInstanceOf(Geopoint.class
 );%0A 

Add a test to confirm that the home location contains valid coordinates