use of com.onesignal.ShadowOneSignalRestClient.SMS_USER_ID in project OneSignal-Android-SDK by OneSignal.
the class MainOneSignalClassRunner method shouldFireSMSSubscriptionObserverOnSetSMS.
@Test
public void shouldFireSMSSubscriptionObserverOnSetSMS() throws Exception {
OneSignalInit();
OSSMSSubscriptionObserver subscriptionObserver = stateChanges -> lastSMSSubscriptionStateChanges = stateChanges;
OneSignal.addSMSSubscriptionObserver(subscriptionObserver);
OneSignal.setSMSNumber(ONESIGNAL_SMS_NUMBER);
threadAndTaskWait();
assertNull(lastSMSSubscriptionStateChanges.getFrom().getSmsUserId());
assertEquals(SMS_USER_ID, lastSMSSubscriptionStateChanges.getTo().getSmsUserId());
assertEquals(ONESIGNAL_SMS_NUMBER, lastSMSSubscriptionStateChanges.getTo().getSMSNumber());
assertTrue(lastSMSSubscriptionStateChanges.getTo().isSubscribed());
}
Aggregations