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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user