AsyncTaskSentenceLoadExecutor implements SentenceLoadExecutor<List<? extends Sentence>, Void>, LoaderManager.LoaderCallbacks<List<? extends Sentence>> { @Override public void onLoadFinished(Loader<List<? extends Sentence>> loader, List<? extends Sentence> data) { LogUtils.v(Constants.TAG, "load sentences done!"); if (mCaseCallback != null) { mCaseCallback.onSuccess(data); } } AsyncTaskSentenceLoadExecutor(Context context, LoaderManager loaderManager); void loadSentences(boolean isFirstLoad, boolean favorite, UseCase.UseCaseCallback<List<? extends Sentence>, Void> callback); @Override Loader<List<? extends Sentence>> onCreateLoader(int id, Bundle args); @Override void onLoadFinished(Loader<List<? extends Sentence>> loader, List<? extends Sentence> data); @Override void onLoaderReset(Loader<List<? extends Sentence>> loader);  }
@Test public void testOnLoadFinished() { mAsyncTaskSentenceLoadExecutor.loadSentences(true, true, mCallback); mAsyncTaskSentenceLoadExecutor.onLoadFinished(mLoader, mMockSentences); verify(mCallback).onSuccess(mMockSentences); }