use of com.onesignal.influence.data.OSTrackerFactory in project OneSignal-Android-SDK by OneSignal.
the class MainOneSignalClassRunner method beforeEachTest.
@Before
public void beforeEachTest() throws Exception {
blankActivityController = Robolectric.buildActivity(BlankActivity.class).create();
blankActivity = blankActivityController.get();
time = new MockOSTimeImpl();
trackerFactory = new OSTrackerFactory(new MockOSSharedPreferences(), new MockOSLog(), time);
sessionManager = new MockSessionManager(OneSignal_getSessionListener(), trackerFactory, new MockOSLog());
dbHelper = new MockOneSignalDBHelper(ApplicationProvider.getApplicationContext());
TestHelpers.setupTestWorkManager(blankActivity);
cleanUp();
OneSignal_setTime(time);
}
use of com.onesignal.influence.data.OSTrackerFactory in project OneSignal-Android-SDK by OneSignal.
the class OutcomeEventIntegrationTests method testOnV2UniqueOutcomeMeasureOnlySentOncePerClickedNotification_whenSendingMultipleUniqueOutcomes_inDirectSession.
@Test
public void testOnV2UniqueOutcomeMeasureOnlySentOncePerClickedNotification_whenSendingMultipleUniqueOutcomes_inDirectSession() throws Exception {
// Enable IAM v2
preferences = new MockOSSharedPreferences();
trackerFactory = new OSTrackerFactory(preferences, logger, time);
sessionManager = new MockSessionManager(sessionListener, trackerFactory, logger);
preferences.saveBool(preferences.getPreferencesName(), preferences.getOutcomesV2KeyName(), true);
OneSignal_setSharedPreferences(preferences);
foregroundAppAfterClickingNotification();
// Send unique outcome event
OneSignal.sendUniqueOutcome(ONESIGNAL_OUTCOME_NAME);
threadAndTaskWait();
JSONArray notificationIds = new JSONArray();
notificationIds.put(ONESIGNAL_NOTIFICATION_ID + "1");
// Check measure end point was most recent request and contains clicked notification
assertMeasureOnV2AtIndex(3, ONESIGNAL_OUTCOME_NAME, new JSONArray(), notificationIds, null, null);
// Only 4 requests have been made
assertRestCalls(4);
// Send unique outcome event
OneSignal.sendUniqueOutcome(ONESIGNAL_OUTCOME_NAME);
threadAndTaskWait();
// Make still only 4 requests have been made
assertRestCalls(4);
}
use of com.onesignal.influence.data.OSTrackerFactory in project OneSignal-Android-SDK by OneSignal.
the class InAppMessageIntegrationTests method beforeEachTest.
@Before
public void beforeEachTest() throws Exception {
ShadowDynamicTimer.shouldScheduleTimers = true;
time = new MockOSTimeImpl();
preferences = new MockOSSharedPreferences();
trackerFactory = new OSTrackerFactory(preferences, new MockOSLog(), time);
sessionManager = new MockSessionManager(OneSignal_getSessionListener(), trackerFactory, new MockOSLog());
blankActivityController = Robolectric.buildActivity(BlankActivity.class).create();
blankActivity = blankActivityController.get();
dbHelper = new MockOneSignalDBHelper(ApplicationProvider.getApplicationContext());
TestHelpers.beforeTestInitAndCleanup();
// Set remote_params GET response
setRemoteParamsGetHtmlResponse();
}
use of com.onesignal.influence.data.OSTrackerFactory in project OneSignal-Android-SDK by OneSignal.
the class SynchronizerIntegrationTests method beforeEachTest.
@Before
public void beforeEachTest() throws Exception {
blankActivityController = Robolectric.buildActivity(BlankActivity.class).create();
blankActivity = blankActivityController.get();
time = new MockOSTimeImpl();
trackerFactory = new OSTrackerFactory(new MockOSSharedPreferences(), new MockOSLog(), time);
sessionManager = new MockSessionManager(OneSignal_getSessionListener(), trackerFactory, new MockOSLog());
dbHelper = new MockOneSignalDBHelper(ApplicationProvider.getApplicationContext());
TestHelpers.setupTestWorkManager(blankActivity);
cleanUp();
OneSignal_setTime(time);
}
use of com.onesignal.influence.data.OSTrackerFactory in project OneSignal-Android-SDK by OneSignal.
the class TrackerUnitTests method beforeEachTest.
// Before each test
@Before
public void beforeEachTest() throws Exception {
MockOSLog logger = new MockOSLog();
MockOSTimeImpl time = new MockOSTimeImpl();
MockOSSharedPreferences preferences = new MockOSSharedPreferences();
trackerFactory = new OSTrackerFactory(preferences, logger, time);
}
Aggregations