File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
app/src/test/java/fr/free/nrw/commons/nearby Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 11package fr .free .nrw .commons .nearby ;
22
33import android .app .Activity ;
4+ import android .location .LocationManager ;
5+
46import org .junit .Before ;
57import org .junit .Test ;
68import org .junit .runner .RunWith ;
79import org .mockito .MockitoAnnotations ;
810import org .robolectric .Robolectric ;
911import org .robolectric .RobolectricTestRunner ;
1012import org .robolectric .RuntimeEnvironment ;
13+ import org .robolectric .Shadows ;
1114import org .robolectric .android .controller .ActivityController ;
1215import org .robolectric .annotation .Config ;
16+ import org .robolectric .shadow .api .Shadow ;
17+ import org .robolectric .shadows .ShadowLocationManager ;
1318
1419import fr .free .nrw .commons .BuildConfig ;
1520import fr .free .nrw .commons .TestCommonsApplication ;
@@ -33,6 +38,7 @@ public void setUp() throws Exception {
3338
3439 TestCommonsApplication application = (TestCommonsApplication ) RuntimeEnvironment .application ;
3540 when (application .getLocationServiceManager ().getLastLocation ()).thenReturn (ST_LOUIS_MO_LAT_LNG );
41+ when (application .getLocationServiceManager ().isProviderEnabled ()).thenReturn (true );
3642
3743 activityController = Robolectric .buildActivity (NearbyActivity .class );
3844 nearbyActivity = activityController .get ();
You can’t perform that action at this time.
0 commit comments