Custom location source fix (#9142)

*  [android] - custom location engine fixes (#9139)

* Update to latest LOST dependency, fixup internal location source integration
This commit is contained in:
Tobrun
2017-06-09 10:00:00 +02:00
committed by GitHub
parent 233117fe57
commit 9f88e37366
20 changed files with 443 additions and 291 deletions

View File

@@ -5,6 +5,7 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException;
import com.mapbox.mapboxsdk.location.LocationSource;
import org.junit.Before;
import org.junit.Test;
@@ -24,11 +25,13 @@ public class MapboxTest {
private Context context;
private Context appContext;
private LocationSource locationSource;
@Before
public void before() {
context = mock(Context.class);
appContext = mock(Context.class);
locationSource = mock(LocationSource.class);
when(context.getApplicationContext()).thenReturn(appContext);
}
@@ -80,7 +83,7 @@ public class MapboxTest {
}
private void injectMapboxSingleton(String accessToken) {
Mapbox mapbox = new Mapbox(appContext, accessToken);
Mapbox mapbox = new Mapbox(appContext, accessToken, locationSource);
try {
Field field = Mapbox.class.getDeclaredField("INSTANCE");
field.setAccessible(true);