use of org.infobip.mobile.messaging.geo.report.GeoReporter in project mobile-messaging-sdk-android by infobip.
the class GeoReporterTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
// Enable message store for notification messages
enableMessageStoreForReceivedMessages();
messageStore = MobileMessaging.getInstance(context).getMessageStore();
mobileApiGeo = mock(MobileApiGeo.class);
geoReporter = new GeoReporter(context, mobileMessagingCore, geoBroadcaster, mobileMessagingCore.getStats(), mobileApiGeo);
geoReportCaptor = new ArgumentCaptor<>();
reportBodyCaptor = ArgumentCaptor.forClass(EventReportBody.class);
given(mobileApiGeo.report(reportBodyCaptor.capture())).willReturn(new EventReportResponse());
}
use of org.infobip.mobile.messaging.geo.report.GeoReporter in project mobile-messaging-sdk-android by infobip.
the class RetryableSynchronizerTest method setUp.
@SuppressLint("CommitPrefEdits")
@Override
public void setUp() throws Exception {
super.setUp();
PreferenceHelper.saveBoolean(context, MobileMessagingProperty.REPORT_SYSTEM_INFO, true);
PreferenceHelper.saveInt(context, MobileMessagingProperty.DEFAULT_EXP_BACKOFF_MULTIPLIER, 0);
PreferenceHelper.remove(context, MobileMessagingProperty.REPORTED_SYSTEM_DATA_HASH);
executor = Executors.newSingleThreadExecutor();
mobileApiGeo = mock(MobileApiGeo.class);
geoReporter = new GeoReporter(context, mobileMessagingCore, geoBroadcaster, mobileMessagingCore.getStats(), mobileApiGeo);
}
use of org.infobip.mobile.messaging.geo.report.GeoReporter 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);
}
use of org.infobip.mobile.messaging.geo.report.GeoReporter in project mobile-messaging-sdk-android by infobip.
the class GeoAreasHandlerTests method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
enableMessageStoreForReceivedMessages();
geoNotificationHelper = Mockito.mock(GeoNotificationHelper.class);
geoReporter = Mockito.mock(GeoReporter.class);
messageStore = Mockito.mock(MessageStore.class);
geoAreasHandler = new GeoAreasHandler(contextMock, mobileMessagingCore, geoNotificationHelper, geoReporter, new GeofencingHelper(context));
geoReportCaptor = ArgumentCaptor.forClass(GeoReport[].class);
geoNotificationCaptor = new ArgumentCaptor<>();
}
Aggregations