NoteListViewModel extends ViewModel<Void, NoteListModel> { public ObservableBoolean getLoading() { return loading; } NoteListViewModel(NoteLoader service, Executor backgroundExecutor, Executor uiExecutor, Navigator navigator); @NonNull @Override NoteListModel createModel(); @Override void resume(); void reloadData(); ObservableBoolean getLoading(); void openDetail(String objectId); void openCreateNewNote(); void onResult(int requestCode, ActivityResult activityResult); @Override int getOptionMenuId(); @Override boolean onOptionsItemSelected(int itemId);  }
@Test public void testLoadingIndicator() { when(service.loadItems()).thenReturn(TestData.response()); viewModel.getLoading().addOnPropertyChangedCallback(callback); viewModel.initAndResume(); verify(callback, times(2)).onPropertyChanged(eq(viewModel.getLoading()), anyInt()); }