@Test public void getMessagesTest() { when(mockChatDao.getMessagesByGroupId(mockGroupId)) .thenReturn(() -> { return null; }); testChatRepository.getMessagesByGroupId(mockGroupId); verify(mockChatDao).getMessagesByGroupId(mockGroupId); }
public LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId) { return new LivePagedListBuilder<>(chatDao.getMessagesByGroupId(groupId), 30).build(); }
ChatRepository { public LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId) { return new LivePagedListBuilder<>(chatDao.getMessagesByGroupId(groupId), 30).build(); } }
ChatRepository { public LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId) { return new LivePagedListBuilder<>(chatDao.getMessagesByGroupId(groupId), 30).build(); } ChatRepository(ChatDao chatDao, RequestEncoder encoder,
                          Handler backgroundHandler); }
ChatRepository { public LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId) { return new LivePagedListBuilder<>(chatDao.getMessagesByGroupId(groupId), 30).build(); } ChatRepository(ChatDao chatDao, RequestEncoder encoder,
                          Handler backgroundHandler); void addMessage(ChatMessage message); LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId); void requestSendMessage(int groupId, String message); void deleteAllMessages(); }
ChatRepository { public LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId) { return new LivePagedListBuilder<>(chatDao.getMessagesByGroupId(groupId), 30).build(); } ChatRepository(ChatDao chatDao, RequestEncoder encoder,
                          Handler backgroundHandler); void addMessage(ChatMessage message); LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId); void requestSendMessage(int groupId, String message); void deleteAllMessages();  }