use of com.fanap.podchat.cachemodel.queue.WaitQueueCache in project pod-chat-android-sdk by FanapSoft.
the class TextMessagesQueueTest method cancelMessage.
@Test
public void cancelMessage() {
List<WaitQueueCache> waiting = chat.getWaitingQ();
System.out.println(">>> Message waiting: " + waiting.size());
WaitQueueCache msgWaiting = waiting.get(0);
chat.cancelMessage(msgWaiting.getUniqueId());
sleep(1000);
Assert.assertTrue(chat.getWaitingQ().stream().noneMatch(message -> message.getUniqueId().equals(msgWaiting.getUniqueId())));
System.out.println(">>> Message waiting: " + chat.getWaitingQ().size());
}
use of com.fanap.podchat.cachemodel.queue.WaitQueueCache in project pod-chat-android-sdk by FanapSoft.
the class TextMessagesQueueTest method resendMessageFromWaitingQ.
@Test
public void resendMessageFromWaitingQ() {
ChatListener mTestListener = Mockito.mock(ChatListener.class);
chat.setListener(mTestListener);
List<WaitQueueCache> waitList = chat.getWaitingQ();
WaitQueueCache wToSend = waitList.remove(0);
chat.resendMessage(wToSend.getUniqueId());
Mockito.verify(mTestListener, Mockito.after(2000).atLeastOnce()).onNewMessage(Mockito.any(), Mockito.argThat((ChatResponse<ResultNewMessage> result) -> result.getResult().getMessageVO().getUniqueId().equals(wToSend.getUniqueId())));
}
Aggregations