<NME> SensorsTest.java
<BEF> package cgeo.geocaching.sensors;

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

import cgeo.geocaching.MainActivity;
import cgeo.geocaching.utils.AngleUtils;

import android.test.ActivityInstrumentationTestCase2;

import io.reactivex.rxjava3.core.Observable;
import static org.assertj.core.api.Java6Assertions.assertThat;

public class SensorsTest extends ActivityInstrumentationTestCase2<MainActivity> {

    private Sensors sensors;

    public SensorsTest() {
        super(MainActivity.class);
    }

    @Override
    protected void setUp() throws Exception {
    protected void setUp() throws Exception {
        super.setUp();
        sensors = Sensors.getInstance();
    }

    public static void testGetDirectionNow() {
        assertThat(angle == 1.0f || angle == 91.0f || angle == 181.0f || angle == 271.0f).isTrue();
    }

    private static <T> void assertDataAvailability(final Observable<T> observable) {
        try {
            observable.timeout(2, TimeUnit.SECONDS).blockingFirst();
        } catch (final Exception ignored) {
            fail("timeout while waiting for sensor data");
        }
    }

    public void testDirectionObservable() {
        assertDataAvailability(sensors.directionDataObservable());
    }

    public void testGeodataObservable() {
        assertDataAvailability(sensors.geoDataObservable(false));
        assertDataAvailability(sensors.geoDataObservable(true));
    }

}

<MSG> Fix sensor tests

Explicit initialization of sensors now required, as they are no longer
started on App start.

<DFF> @@ -3,6 +3,7 @@ package cgeo.geocaching.sensors;
 import static org.assertj.core.api.Java6Assertions.assertThat;
 
 import cgeo.geocaching.MainActivity;
+import cgeo.geocaching.settings.Settings;
 import cgeo.geocaching.utils.AngleUtils;
 
 import android.test.ActivityInstrumentationTestCase2;
@@ -23,6 +24,8 @@ public class SensorsTest extends ActivityInstrumentationTestCase2<MainActivity>
     protected void setUp() throws Exception {
         super.setUp();
         sensors = Sensors.getInstance();
+        sensors.setupGeoDataObservables(Settings.useGooglePlayServices(), Settings.useLowPowerMode());
+        sensors.setupDirectionObservable();
     }
 
     public static void testGetDirectionNow() {

Fix sensor tests