use of com.fanap.podchat.mainmodel.History in project pod-chat-android-sdk by FanapSoft.
the class LocalChatTest method getHistoryFromTime.
/*old method*/
@Test
@MediumTest
public void getHistoryFromTime() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
long threadId = 1288;
History history = new History.Builder().fromTime(235566).fromTimeNanos(2).build();
presenter.getHistory(history, threadId, null);
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Mockito.verify(view, Mockito.times(1)).onGetThreadHistory(Mockito.any());
}
use of com.fanap.podchat.mainmodel.History in project pod-chat-android-sdk by FanapSoft.
the class ChatTestIntegration method getThreadHistory.
// Get History
@Test
@MediumTest
public void getThreadHistory() {
sleep(3000);
History history = new History.Builder().count(5).build();
presenter.getHistory(history, 381, null);
sleep(3000);
Mockito.verify(view, Mockito.times(1)).onGetThreadHistory(Mockito.any());
}
use of com.fanap.podchat.mainmodel.History in project pod-chat-android-sdk by FanapSoft.
the class ChatTest method getThreadHistory.
// Get History
@Test
@MediumTest
public void getThreadHistory() {
sleep(3000);
History history = new History.Builder().count(5).build();
presenter.getHistory(history, 381, null);
sleep(3000);
Mockito.verify(view, Mockito.times(1)).onGetThreadHistory(Mockito.any());
}
use of com.fanap.podchat.mainmodel.History in project pod-chat-android-sdk by FanapSoft.
the class MessageDatabaseHelper method updateGetHistoryResponse.
public void updateGetHistoryResponse(@NonNull Callback callback, @NonNull List<MessageVO> messageVOS, long threadId, @NonNull List<CacheMessageVO> cMessageVOS) {
worker(() -> {
long count = callback.getCount();
long offset = callback.getOffset();
long firstMessageId = callback.getFirstMessageId();
long lastMessageId = callback.getLastMessageId();
long messageId = callback.getMessageId();
long fromTime = callback.getFromTime();
long fromTimeNanos = callback.getFromTimeNanos();
long toTimeNanos = callback.getToTimeNanos();
long toTime = callback.getToTime();
String order = callback.getOrder();
String query = callback.getQuery();
History history = new History.Builder().id(messageId).count(count).fromTime(fromTime).fromTimeNanos(fromTimeNanos).toTime(toTime).toTimeNanos(toTimeNanos).order(order).offset(offset).query(query).build();
if (!callback.isMetadataCriteria()) {
if (order.equals("asc")) {
whereClauseAsc(history, messageVOS, threadId, cMessageVOS);
} else {
whereClauseDesc(history, messageVOS, threadId, cMessageVOS);
}
}
});
}
use of com.fanap.podchat.mainmodel.History in project pod-chat-android-sdk by FanapSoft.
the class ChatTestSandbox method getThreadHistory.
// Get History
@Test
@MediumTest
public void getThreadHistory() {
sleep(3000);
History history = new History.Builder().count(5).build();
presenter.getHistory(history, 381, null);
sleep(3000);
Mockito.verify(view, Mockito.times(1)).onGetThreadHistory(Mockito.any());
}
Aggregations