use of org.infobip.mobile.messaging.notification.NotificationHandler in project mobile-messaging-sdk-android by infobip.
the class MobileMessagingTestCase method setUp.
@SuppressLint("ApplySharedPref")
@Before
public void setUp() throws Exception {
super.setUp();
PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commit();
PreferenceHelper.saveString(context, MobileMessagingProperty.API_URI, "http://127.0.0.1:" + debugServer.getListeningPort() + "/");
PreferenceHelper.saveString(context, MobileMessagingProperty.APPLICATION_CODE, "TestApplicationCode");
PreferenceHelper.saveString(context, MobileMessagingProperty.INFOBIP_REGISTRATION_ID, "TestDeviceInstanceId");
PreferenceHelper.saveString(context, MobileMessagingProperty.GCM_REGISTRATION_ID, "TestRegistrationId");
PreferenceHelper.saveBoolean(context, MobileMessagingProperty.GCM_REGISTRATION_ID_REPORTED, true);
MobileMessagingLogger.enforce();
time = new TestTimeProvider();
Time.reset(time);
notificationHandler = mock(NotificationHandler.class);
coreBroadcaster = mock(Broadcaster.class);
mobileApiMessages = mock(MobileApiMessages.class);
mobileApiRegistration = mock(MobileApiRegistration.class);
mobileApiResourceProvider = mock(MobileApiResourceProvider.class);
given(mobileApiResourceProvider.getMobileApiMessages(any(Context.class))).willReturn(mobileApiMessages);
given(mobileApiResourceProvider.getMobileApiRegistration(any(Context.class))).willReturn(mobileApiRegistration);
mobileMessagingCore = MobileMessagingTestable.create(context, coreBroadcaster, mobileApiResourceProvider);
mobileMessaging = mobileMessagingCore;
geofencingHelper = new GeofencingHelper(context);
geoBroadcaster = mock(GeoBroadcaster.class);
geofencingHelper.removeUnreportedGeoEvents();
databaseHelper = MobileMessagingCore.getDatabaseHelper(context);
databaseProvider = MobileMessagingCore.getDatabaseProvider(context);
geoStore = geofencingHelper.getMessageStoreForGeo();
}
Aggregations