File tree 1 file changed +6
-0
lines changed
app/src/test/java/fr/free/nrw/commons/nearby
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1
1
package fr .free .nrw .commons .nearby ;
2
2
3
3
import android .app .Activity ;
4
+ import android .location .LocationManager ;
5
+
4
6
import org .junit .Before ;
5
7
import org .junit .Test ;
6
8
import org .junit .runner .RunWith ;
7
9
import org .mockito .MockitoAnnotations ;
8
10
import org .robolectric .Robolectric ;
9
11
import org .robolectric .RobolectricTestRunner ;
10
12
import org .robolectric .RuntimeEnvironment ;
13
+ import org .robolectric .Shadows ;
11
14
import org .robolectric .android .controller .ActivityController ;
12
15
import org .robolectric .annotation .Config ;
16
+ import org .robolectric .shadow .api .Shadow ;
17
+ import org .robolectric .shadows .ShadowLocationManager ;
13
18
14
19
import fr .free .nrw .commons .BuildConfig ;
15
20
import fr .free .nrw .commons .TestCommonsApplication ;
@@ -33,6 +38,7 @@ public void setUp() throws Exception {
33
38
34
39
TestCommonsApplication application = (TestCommonsApplication ) RuntimeEnvironment .application ;
35
40
when (application .getLocationServiceManager ().getLastLocation ()).thenReturn (ST_LOUIS_MO_LAT_LNG );
41
+ when (application .getLocationServiceManager ().isProviderEnabled ()).thenReturn (true );
36
42
37
43
activityController = Robolectric .buildActivity (NearbyActivity .class );
38
44
nearbyActivity = activityController .get ();
You can’t perform that action at this time.
0 commit comments