use of com.fanap.podchat.util.ChatStateType.ChatSateConstant.CHAT_READY in project pod-chat-android-sdk by FanapSoft.
the class TextMessagesQueueTest method checkSendingQueue.
@Test
public void checkSendingQueue() {
populateThreadsListFromServerOnly();
assert threads.size() > 0;
Thread thread = threads.get(0);
ChatListener mTestListener = Mockito.mock(ChatListener.class);
chat.setListener(mTestListener);
chat.closeChat();
sleep(2000);
Assert.assertNotEquals(chat.getChatState(), CHAT_READY);
RequestMessage request = new RequestMessage.Builder("Android Test " + new Date(), thread.getId()).messageType(TextMessageType.Constants.TEXT).build();
String uniqueId = chat.sendTextMessage(request, null);
List<SendingQueueCache> sendQ = chat.getSendingQ();
Assert.assertTrue(sendQ.stream().anyMatch(sendingQueueCache -> sendingQueueCache.getUniqueId().equals(uniqueId)));
}
Aggregations