use of org.odk.collect.location.tracker.LocationTracker in project collect by opendatakit.
the class GeoPolyActivityTest method setUp.
@Before
public void setUp() throws Exception {
ShadowApplication shadowApplication = shadowOf(ApplicationProvider.<Application>getApplicationContext());
shadowApplication.grantPermissions("android.permission.ACCESS_FINE_LOCATION");
shadowApplication.grantPermissions("android.permission.ACCESS_COARSE_LOCATION");
RobolectricApplication application = ApplicationProvider.getApplicationContext();
application.geoDependencyComponent = DaggerGeoDependencyComponent.builder().application(application).geoDependencyModule(new GeoDependencyModule() {
@NonNull
@Override
public MapFragmentFactory providesMapFragmentFactory() {
return (context) -> mapFragment;
}
@NonNull
@Override
public ReferenceLayerSettingsNavigator providesReferenceLayerSettingsNavigator() {
return (activity) -> {
};
}
@NonNull
@Override
public LocationTracker providesLocationTracker() {
return locationTracker;
}
}).build();
}
Aggregations