use of org.infobip.mobile.messaging.api.geo.MobileApiGeo in project mobile-messaging-sdk-android by infobip.
the class MobileApiGeoTest method setUp.
@Before
public void setUp() throws Exception {
debugServer = new DebugServer();
debugServer.start();
Properties properties = new Properties();
properties.put("api.key", "my_API_key");
Generator generator = new Generator.Builder().withBaseUrl("http://127.0.0.1:" + debugServer.getListeningPort() + "/").withProperties(properties).build();
mobileApiGeo = generator.create(MobileApiGeo.class);
}
use of org.infobip.mobile.messaging.api.geo.MobileApiGeo 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.api.geo.MobileApiGeo 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.api.geo.MobileApiGeo 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);
}
Aggregations