Search in sources :

Example 6 with MobileApiMessages

use of org.infobip.mobile.messaging.api.messages.MobileApiMessages in project mobile-messaging-sdk-android by infobip.

the class PushUnregisteredTest method setUp.

@SuppressLint({ "CommitPrefEdits", "ApplySharedPref" })
@Override
public void setUp() throws Exception {
    super.setUp();
    ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
    MobileMessagingStats stats = mobileMessagingCore.getStats();
    PreferenceHelper.saveLong(context, MobileMessagingProperty.BATCH_REPORTING_DELAY, 100L);
    PreferenceHelper.saveBoolean(context, MobileMessagingProperty.GEOFENCING_ACTIVATED, true);
    mobileApiMessages = mock(MobileApiMessages.class);
    mobileApiGeo = mock(MobileApiGeo.class);
    mobileMessageHandler = mock(MobileMessageHandler.class);
    RetryPolicyProvider retryPolicyProvider = new RetryPolicyProvider(context);
    retryPolicy = retryPolicyProvider.DEFAULT();
    registrationSynchronizer = new RegistrationSynchronizer(context, mobileMessagingCore, stats, taskExecutor, coreBroadcaster, retryPolicyProvider, mobileApiRegistration);
    seenStatusReporter = new SeenStatusReporter(mobileMessagingCore, stats, taskExecutor, coreBroadcaster, mobileApiMessages, new BatchReporter(100L));
    geoReporter = new GeoReporter(context, mobileMessagingCore, geoBroadcaster, mobileMessagingCore.getStats(), mobileApiGeo);
    messagesSynchronizer = new MessagesSynchronizer(mobileMessagingCore, stats, taskExecutor, coreBroadcaster, retryPolicy, mobileMessageHandler, mobileApiMessages);
    captor = ArgumentCaptor.forClass(Boolean.class);
}
Also used : MobileMessageHandler(org.infobip.mobile.messaging.gcm.MobileMessageHandler) MobileMessagingStats(org.infobip.mobile.messaging.stats.MobileMessagingStats) RetryPolicyProvider(org.infobip.mobile.messaging.mobile.common.RetryPolicyProvider) ExecutorService(java.util.concurrent.ExecutorService) MobileApiGeo(org.infobip.mobile.messaging.api.geo.MobileApiGeo) BatchReporter(org.infobip.mobile.messaging.mobile.BatchReporter) MessagesSynchronizer(org.infobip.mobile.messaging.mobile.messages.MessagesSynchronizer) MobileApiMessages(org.infobip.mobile.messaging.api.messages.MobileApiMessages) GeoReporter(org.infobip.mobile.messaging.geo.report.GeoReporter) Matchers.anyBoolean(org.mockito.Matchers.anyBoolean) RegistrationSynchronizer(org.infobip.mobile.messaging.mobile.registration.RegistrationSynchronizer) SeenStatusReporter(org.infobip.mobile.messaging.mobile.seen.SeenStatusReporter) SuppressLint(android.annotation.SuppressLint)

Aggregations

MobileApiMessages (org.infobip.mobile.messaging.api.messages.MobileApiMessages)6 SuppressLint (android.annotation.SuppressLint)4 MobileMessagingStats (org.infobip.mobile.messaging.stats.MobileMessagingStats)3 Before (org.junit.Before)3 Context (android.content.Context)2 MobileApiData (org.infobip.mobile.messaging.api.data.MobileApiData)2 MobileApiRegistration (org.infobip.mobile.messaging.api.registration.MobileApiRegistration)2 MobileMessageHandler (org.infobip.mobile.messaging.gcm.MobileMessageHandler)2 BatchReporter (org.infobip.mobile.messaging.mobile.BatchReporter)2 MobileApiResourceProvider (org.infobip.mobile.messaging.mobile.MobileApiResourceProvider)2 RetryPolicyProvider (org.infobip.mobile.messaging.mobile.common.RetryPolicyProvider)2 MessagesSynchronizer (org.infobip.mobile.messaging.mobile.messages.MessagesSynchronizer)2 RegistrationSynchronizer (org.infobip.mobile.messaging.mobile.registration.RegistrationSynchronizer)2 SeenStatusReporter (org.infobip.mobile.messaging.mobile.seen.SeenStatusReporter)2 NotificationHandler (org.infobip.mobile.messaging.notification.NotificationHandler)2 Broadcaster (org.infobip.mobile.messaging.platform.Broadcaster)2 Properties (java.util.Properties)1 Executor (java.util.concurrent.Executor)1 ExecutorService (java.util.concurrent.ExecutorService)1 Executors.newSingleThreadExecutor (java.util.concurrent.Executors.newSingleThreadExecutor)1