Search in sources :

Example 6 with RegistrationResponse

use of org.infobip.mobile.messaging.api.registration.RegistrationResponse in project mobile-messaging-sdk-android by infobip.

the class PushUnregisteredTest method test_push_registration_disabled.

@Test
public void test_push_registration_disabled() throws Exception {
    // Given
    given(mobileApiRegistration.upsert(anyString(), anyBoolean())).willReturn(new RegistrationResponse("testDeviceApplicationInstanceId", false));
    // Then
    verifyRegistrationStatusUpdate(after(1000).atLeastOnce(), false);
    boolean isPushRegistrationEnabled = captor.getValue();
    assertFalse(isPushRegistrationEnabled);
    verifySeenStatusReporter(after(1000).atLeastOnce());
    // reports should NOT be called if push is disabled
    verifyGeoReporting(after(1000).never());
    verifyMessagesSynchronizer(after(1000).never());
}
Also used : RegistrationResponse(org.infobip.mobile.messaging.api.registration.RegistrationResponse) Test(org.junit.Test)

Aggregations

RegistrationResponse (org.infobip.mobile.messaging.api.registration.RegistrationResponse)6 Test (org.junit.Test)4 MobileApiRegistration (org.infobip.mobile.messaging.api.registration.MobileApiRegistration)2 MRetryableTask (org.infobip.mobile.messaging.mobile.common.MRetryableTask)2