BootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (LOCAL_LOGV) Log.v(TAG, "onReceive(" + context + "," + intent + ")"); if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { bootup(context); } else { Log.w(TAG, "unhandled intent: "+intent); } }  @Override void onReceive(Context context, Intent intent);  }
@Test public void shouldScheduleBootupBackupAfterBootup() throws Exception { receiver.onReceive(RuntimeEnvironment.application, new Intent().setAction(Intent.ACTION_BOOT_COMPLETED)); verify(backupJobs, times(1)).scheduleBootup(); }