use of org.odk.collect.android.fakes.FakePermissionsProvider in project collect by opendatakit.
the class BackgroundAudioPermissionDialogFragmentTest method setup.
@Before
public void setup() {
backgroundAudioViewModel = mock(BackgroundAudioViewModel.class);
fakePermissionsProvider = new FakePermissionsProvider();
CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {
@Override
public BackgroundAudioViewModel.Factory providesBackgroundAudioViewModelFactory(AudioRecorder audioRecorder, SettingsProvider settingsProvider, PermissionsChecker permissionsChecker, Analytics analytics) {
return new BackgroundAudioViewModel.Factory(audioRecorder, settingsProvider.getUnprotectedSettings(), permissionsChecker, System::currentTimeMillis) {
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
return (T) backgroundAudioViewModel;
}
};
}
@Override
public PermissionsProvider providesPermissionsProvider(PermissionsChecker permissionsChecker) {
return fakePermissionsProvider;
}
});
}
Aggregations