BlankFormsListViewModel extends ViewModel { public LiveData<Boolean> isSyncing() { return syncRepository.isSyncing(); } BlankFormsListViewModel(Application application, Scheduler scheduler, SyncStatusRepository syncRepository, ServerFormsSynchronizer serverFormsSynchronizer, PreferencesProvider preferencesProvider, Notifier notifier, ChangeLock changeLock, Analytics analytics); boolean isMatchExactlyEnabled(); LiveData<Boolean> isSyncing(); LiveData<Boolean> isOutOfSync(); LiveData<Boolean> isAuthenticationRequired(); LiveData<Boolean> syncWithServer();  }
@Test public void isSyncing_followsRepositoryIsSyncing() { MutableLiveData<Boolean> liveData = new MutableLiveData<>(true); when(syncRepository.isSyncing()).thenReturn(liveData); BlankFormsListViewModel viewModel = new BlankFormsListViewModel(mock(Application.class), mock(Scheduler.class), syncRepository, mock(ServerFormsSynchronizer.class), preferencesProvider, mock(Notifier.class), changeLock, analytics); assertThat(viewModel.isSyncing().getValue(), is(true)); liveData.setValue(false); assertThat(viewModel.isSyncing().getValue(), is(false)); }