use of com.applozic.mobicomkit.sync.SyncUserDetailsResponse in project Applozic-Android-SDK by AppLozic.
the class MessageServiceTest method processUserDetails.
@Test
public void processUserDetails() {
try {
List<UserDetail> userDetails = new ArrayList<UserDetail>();
userDetails.add(new UserDetail());
SyncUserDetailsResponse response = new SyncUserDetailsResponse();
response.setGeneratedAt("GEneratedAtString");
response.setStatus("success");
response.setResponse(userDetails);
when(messageClientService.getUserDetailsList(anyString())).thenReturn(response);
when(appContactService.getContactById("")).thenReturn(new Contact());
// Mockito.doNothing().when(appContactService).upsert(any(Contact.class));
mobiComConversationService.processLastSeenAtStatus();
assertEquals(response.getGeneratedAt(), MobiComUserPreference.getInstance(context).getLastSeenAtSyncTime());
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.applozic.mobicomkit.sync.SyncUserDetailsResponse in project Applozic-Android-SDK by AppLozic.
the class MessageClientService method getUserDetailsList.
// Cleanup: default
public SyncUserDetailsResponse getUserDetailsList(String lastSeenAt) {
try {
String url = getUserDetailsListUrl() + "?lastSeenAt=" + lastSeenAt;
String response = httpRequestUtils.getResponse(url, "application/json", "application/json");
if (response == null || TextUtils.isEmpty(response) || response.equals("UnAuthorized Access")) {
return null;
}
Utils.printLog(context, TAG, "Sync UserDetails response is:" + response);
SyncUserDetailsResponse userDetails = (SyncUserDetailsResponse) GsonUtils.getObjectFromJson(response, SyncUserDetailsResponse.class);
return userDetails;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
use of com.applozic.mobicomkit.sync.SyncUserDetailsResponse in project Applozic-Android-SDK by AppLozic.
the class ConversationServiceTest method processUserDetails.
@Test
public void processUserDetails() {
try {
List<UserDetail> userDetails = new ArrayList<UserDetail>();
userDetails.add(new UserDetail());
SyncUserDetailsResponse response = new SyncUserDetailsResponse();
response.setGeneratedAt("GeneratedAtString");
response.setStatus("success");
response.setResponse(userDetails);
Mockito.when(messageClientService.getUserDetailsList(ArgumentMatchers.anyString())).thenReturn(response);
Mockito.when(appContactService.getContactById("")).thenReturn(new Contact());
Mockito.doNothing().when(appContactService).upsert(ArgumentMatchers.any(Contact.class));
mobiComConversationService.processLastSeenAtStatus();
Assert.assertEquals(response.getGeneratedAt(), MobiComUserPreference.getInstance(context).getLastSeenAtSyncTime());
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations