use of org.odk.collect.android.geo.MapProvider in project collect by opendatakit.
the class FormMapActivityTest method setUpActivity.
@Before
public void setUpActivity() {
CollectHelpers.setupDemoProject();
AppDependencyComponent component = CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {
@Override
public MapProvider providesMapProvider() {
MapProvider mapProvider = mock(MapProvider.class);
when(mapProvider.createMapFragment(ArgumentMatchers.any())).thenReturn(map);
return mapProvider;
}
});
FormsRepository formsRepository = component.formsRepositoryProvider().get();
instancesRepository = component.instancesRepositoryProvider().get();
form = formsRepository.save(testForm);
Arrays.stream(testInstances).forEach(instancesRepository::save);
Intent intent = new Intent();
intent.putExtra(FormMapActivity.EXTRA_FORM_ID, form.getDbId());
activityController = CollectHelpers.buildThemedActivity(FormMapActivity.class, intent);
activity = (FormMapActivity) activityController.get();
activityController.setup();
}
Aggregations