@Test public void reloadAdapterTest() { postRecyclerViewAdapter.allPosts = postsMock; postRecyclerViewAdapter.reloadAdapter(posts); verify(postsMock, times(1)).clear(); verify(postsMock, times(1)).addAll(posts); verifyNoMoreInteractions(postsMock); }
@Override public void reloadAdapter(final List<Post> posts) { Timber.d("Reloading post recycler view adapter."); allPosts.clear(); allPosts.addAll(posts); notifyDataSetChanged(); }
PostRecyclerViewAdapter extends RecyclerView.Adapter<PostViewHolder> implements RecyclerViewAdapter { @Override public void reloadAdapter(final List<Post> posts) { Timber.d("Reloading post recycler view adapter."); allPosts.clear(); allPosts.addAll(posts); notifyDataSetChanged(); } }
PostRecyclerViewAdapter extends RecyclerView.Adapter<PostViewHolder> implements RecyclerViewAdapter { @Override public void reloadAdapter(final List<Post> posts) { Timber.d("Reloading post recycler view adapter."); allPosts.clear(); allPosts.addAll(posts); notifyDataSetChanged(); } PostRecyclerViewAdapter(final OnViewClickListener onViewClickListener); }
PostRecyclerViewAdapter extends RecyclerView.Adapter<PostViewHolder> implements RecyclerViewAdapter { @Override public void reloadAdapter(final List<Post> posts) { Timber.d("Reloading post recycler view adapter."); allPosts.clear(); allPosts.addAll(posts); notifyDataSetChanged(); } PostRecyclerViewAdapter(final OnViewClickListener onViewClickListener); @Override PostViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType); @Override void onBindViewHolder(final PostViewHolder holder, final int position); @Override int getItemCount(); @Override void reloadAdapter(final List<Post> posts); @Override Post getItem(int position); }
PostRecyclerViewAdapter extends RecyclerView.Adapter<PostViewHolder> implements RecyclerViewAdapter { @Override public void reloadAdapter(final List<Post> posts) { Timber.d("Reloading post recycler view adapter."); allPosts.clear(); allPosts.addAll(posts); notifyDataSetChanged(); } PostRecyclerViewAdapter(final OnViewClickListener onViewClickListener); @Override PostViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType); @Override void onBindViewHolder(final PostViewHolder holder, final int position); @Override int getItemCount(); @Override void reloadAdapter(final List<Post> posts); @Override Post getItem(int position);  }