Search in sources :

Example 1 with RequestGetUserRoles

use of com.fanap.podchat.requestobject.RequestGetUserRoles in project pod-chat-android-sdk by FanapSoft.

the class ThreadManager method safeLeaveThread.

public static void safeLeaveThread(SafeLeaveRequest request, String uniqueId, ISafeLeaveCallback callback) {
    requestUniqueId = uniqueId;
    if (request.getSuccessorParticipantId() == 0) {
        createAndSendNormalLeave(request, uniqueId, callback);
    } else {
        RequestGetUserRoles requestGetUserRoles = new RequestGetUserRoles.Builder().setThreadId(request.getThreadId()).withNoCache().build();
        userRolesSubscriber = PublishSubject.create();
        userRolesSubscription = userRolesSubscriber.subscribe(createOnReceiveUserRolesAction(request, uniqueId, callback));
        callback.onGetUserRolesNeeded(requestGetUserRoles, uniqueId);
    }
}
Also used : RequestGetUserRoles(com.fanap.podchat.requestobject.RequestGetUserRoles)

Example 2 with RequestGetUserRoles

use of com.fanap.podchat.requestobject.RequestGetUserRoles in project pod-chat-android-sdk by FanapSoft.

the class ChatTest method getCurrentUserRoles.

public void getCurrentUserRoles(long threadID) {
    RequestGetUserRoles req = new RequestGetUserRoles.Builder().setThreadId(threadID).build();
    presenter.getUserRoles(req);
    sleep(1000);
    Mockito.verify(view, Mockito.atLeastOnce()).onGetCurrentUserRoles(Mockito.any());
}
Also used : RequestGetUserRoles(com.fanap.podchat.requestobject.RequestGetUserRoles)

Example 3 with RequestGetUserRoles

use of com.fanap.podchat.requestobject.RequestGetUserRoles in project pod-chat-android-sdk by FanapSoft.

the class ChatTest method getCurrentUserRoles.

@Test
@LargeTest
public void getCurrentUserRoles() {
    RequestGetUserRoles req = new RequestGetUserRoles.Builder().setThreadId(5801).build();
    chat.getCurrentUserRoles(req);
    sleep(1000);
    // Mockito.verify(view, Mockito.atLeastOnce()).onGetCurrentUserRoles(Mockito.any());
    Mockito.verify(chatListeners, Mockito.atLeastOnce()).onError(Mockito.any(), Mockito.any());
}
Also used : RequestGetUserRoles(com.fanap.podchat.requestobject.RequestGetUserRoles) FlakyTest(android.support.test.filters.FlakyTest) MediumTest(android.support.test.filters.MediumTest) Test(org.junit.Test) LargeTest(android.support.test.filters.LargeTest) LargeTest(android.support.test.filters.LargeTest)

Example 4 with RequestGetUserRoles

use of com.fanap.podchat.requestobject.RequestGetUserRoles in project pod-chat-android-sdk by FanapSoft.

the class ChatTestIntegration method getCurrentUserRoles.

public void getCurrentUserRoles(long threadID) {
    RequestGetUserRoles req = new RequestGetUserRoles.Builder().setThreadId(threadID).build();
    presenter.getUserRoles(req);
    sleep(1000);
    Mockito.verify(view, Mockito.atLeastOnce()).onGetCurrentUserRoles(Mockito.any());
}
Also used : RequestGetUserRoles(com.fanap.podchat.requestobject.RequestGetUserRoles)

Example 5 with RequestGetUserRoles

use of com.fanap.podchat.requestobject.RequestGetUserRoles in project pod-chat-android-sdk by FanapSoft.

the class ChatTestSandbox method getCurrentUserRoles.

public void getCurrentUserRoles(long threadID) {
    RequestGetUserRoles req = new RequestGetUserRoles.Builder().setThreadId(threadID).build();
    presenter.getUserRoles(req);
    sleep(1000);
    Mockito.verify(view, Mockito.atLeastOnce()).onGetCurrentUserRoles(Mockito.any());
}
Also used : RequestGetUserRoles(com.fanap.podchat.requestobject.RequestGetUserRoles)

Aggregations

RequestGetUserRoles (com.fanap.podchat.requestobject.RequestGetUserRoles)8 FlakyTest (android.support.test.filters.FlakyTest)3 LargeTest (android.support.test.filters.LargeTest)3 MediumTest (android.support.test.filters.MediumTest)3 Test (org.junit.Test)3 GsonBuilder (com.google.gson.GsonBuilder)1