@Test public void testBackgroundPush() { when(pushManager.isComponentEnabled()).thenReturn(true); when(pushManager.isPushEnabled()).thenReturn(true); when(pushManager.isOptIn()).thenReturn(true); when(pushManager.isUniqueCanonicalId("testPushID")).thenReturn(true); pushRunnable.run(); verify(pushListener).onPushReceived(message, false); }
@Override public void run() { Autopilot.automaticTakeOff(context); long airshipWaitTime = isLongRunning ? LONG_AIRSHIP_WAIT_TIME_MS : AIRSHIP_WAIT_TIME_MS; UAirship airship = UAirship.waitForTakeOff(airshipWaitTime); if (airship == null) { Logger.error("Unable to process push, Airship is not ready. Make sure takeOff is called by either using autopilot or by calling takeOff in the application's onCreate method."); return; } if (!message.isAccengagePush() && !message.isAirshipPush()) { Logger.debug("Ignoring push: %s", message); return; } if (checkProvider(airship, providerClass)) { if (isProcessed) { postProcessPush(airship); } else { processPush(airship); } } }
IncomingPushRunnable implements Runnable { @Override public void run() { Autopilot.automaticTakeOff(context); long airshipWaitTime = isLongRunning ? LONG_AIRSHIP_WAIT_TIME_MS : AIRSHIP_WAIT_TIME_MS; UAirship airship = UAirship.waitForTakeOff(airshipWaitTime); if (airship == null) { Logger.error("Unable to process push, Airship is not ready. Make sure takeOff is called by either using autopilot or by calling takeOff in the application's onCreate method."); return; } if (!message.isAccengagePush() && !message.isAirshipPush()) { Logger.debug("Ignoring push: %s", message); return; } if (checkProvider(airship, providerClass)) { if (isProcessed) { postProcessPush(airship); } else { processPush(airship); } } } }
IncomingPushRunnable implements Runnable { @Override public void run() { Autopilot.automaticTakeOff(context); long airshipWaitTime = isLongRunning ? LONG_AIRSHIP_WAIT_TIME_MS : AIRSHIP_WAIT_TIME_MS; UAirship airship = UAirship.waitForTakeOff(airshipWaitTime); if (airship == null) { Logger.error("Unable to process push, Airship is not ready. Make sure takeOff is called by either using autopilot or by calling takeOff in the application's onCreate method."); return; } if (!message.isAccengagePush() && !message.isAirshipPush()) { Logger.debug("Ignoring push: %s", message); return; } if (checkProvider(airship, providerClass)) { if (isProcessed) { postProcessPush(airship); } else { processPush(airship); } } } private  IncomingPushRunnable(@NonNull Builder builder); }
IncomingPushRunnable implements Runnable { @Override public void run() { Autopilot.automaticTakeOff(context); long airshipWaitTime = isLongRunning ? LONG_AIRSHIP_WAIT_TIME_MS : AIRSHIP_WAIT_TIME_MS; UAirship airship = UAirship.waitForTakeOff(airshipWaitTime); if (airship == null) { Logger.error("Unable to process push, Airship is not ready. Make sure takeOff is called by either using autopilot or by calling takeOff in the application's onCreate method."); return; } if (!message.isAccengagePush() && !message.isAirshipPush()) { Logger.debug("Ignoring push: %s", message); return; } if (checkProvider(airship, providerClass)) { if (isProcessed) { postProcessPush(airship); } else { processPush(airship); } } } private  IncomingPushRunnable(@NonNull Builder builder); @Override void run(); }
IncomingPushRunnable implements Runnable { @Override public void run() { Autopilot.automaticTakeOff(context); long airshipWaitTime = isLongRunning ? LONG_AIRSHIP_WAIT_TIME_MS : AIRSHIP_WAIT_TIME_MS; UAirship airship = UAirship.waitForTakeOff(airshipWaitTime); if (airship == null) { Logger.error("Unable to process push, Airship is not ready. Make sure takeOff is called by either using autopilot or by calling takeOff in the application's onCreate method."); return; } if (!message.isAccengagePush() && !message.isAirshipPush()) { Logger.debug("Ignoring push: %s", message); return; } if (checkProvider(airship, providerClass)) { if (isProcessed) { postProcessPush(airship); } else { processPush(airship); } } } private  IncomingPushRunnable(@NonNull Builder builder); @Override void run();  }