urbanairship-core/src/test/java/com/urbanairship/push/IncomingPushRunnableTest.java
@Test
    public void testNotifyLegacyIamManager() {
        when(pushManager.isComponentEnabled()).thenReturn(true);
        when(pushManager.isPushEnabled()).thenReturn(true);
        when(pushManager.isOptIn()).thenReturn(true);
        when(pushManager.isUniqueCanonicalId("testPushID")).thenReturn(true);

        PushMessage push = new PushMessage(pushBundle);
        pushRunnable = new IncomingPushRunnable.Builder(TestApplication.getApplication())
                .setProviderClass(testPushProvider.getClass().toString())
                .setMessage(push)
                .setNotificationManager(notificationManager)
                .setLongRunning(true)
                .build();

        pushRunnable.run();

        verify(legacyInAppMessageManager).onPushReceived(push);
    }
/**
     * Test the legacy in-app message manager is notified of the push.
     */
Test the legacy in-app message manager is notified of the push.
Test the legacy in - app message manager is notified of the push .
@Test
    public void testNotifyLegacyIamManager() {
        when(pushManager.isComponentEnabled()).thenReturn(true);
        when(pushManager.isPushEnabled()).thenReturn(true);
        when(pushManager.isOptIn()).thenReturn(true);
        when(pushManager.isUniqueCanonicalId("testPushID")).thenReturn(true);
        PushMessage push = new PushMessage(pushBundle);
        pushRunnable = new IncomingPushRunnable.Builder(TestApplication.getApplication())
                .setProviderClass(testPushProvider.getClass().toString())
                .setMessage(push)
                .setNotificationManager(notificationManager)
                .setLongRunning(true)
                .build();
        pushRunnable.run();
        verify(legacyInAppMessageManager).onPushReceived(push);
    }
@ Test public void testNotifyLegacyIamManager ( ) { when ( pushManager . isComponentEnabled ( ) ) . thenReturn ( true ) ; when ( pushManager . isPushEnabled ( ) ) . thenReturn ( true ) ; when ( pushManager . isOptIn ( ) ) . thenReturn ( true ) ; when ( pushManager . isUniqueCanonicalId ( "testPushID" ) ) . thenReturn ( true ) ; PushMessage push = new PushMessage ( pushBundle ) ; pushRunnable = new IncomingPushRunnable . Builder ( TestApplication . getApplication ( ) ) . setProviderClass ( testPushProvider . getClass ( ) . toString ( ) ) . setMessage ( push ) . setNotificationManager ( notificationManager ) . setLongRunning ( true ) . build ( ) ; pushRunnable . run ( ) ; verify ( legacyInAppMessageManager ) . onPushReceived ( push ) ; }
Test the legacy in-app message manager is notified of the push.
Test the legacy in - app message manager is notified of the push .