@Test public void onInvalidIntent() { new PushReceiver().onReceive(mock(Context.class), mock(Intent.class)); verifyZeroInteractions(mPush); }
@Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (INTENT_ACTION_REGISTRATION.equals(action)) { String registrationId = intent.getStringExtra(INTENT_EXTRA_REGISTRATION); Push.getInstance().onTokenRefresh(registrationId); } else if (INTENT_ACTION_RECEIVE.equals(action)) { Push.getInstance().onMessageReceived(context, intent); } }
PushReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (INTENT_ACTION_REGISTRATION.equals(action)) { String registrationId = intent.getStringExtra(INTENT_EXTRA_REGISTRATION); Push.getInstance().onTokenRefresh(registrationId); } else if (INTENT_ACTION_RECEIVE.equals(action)) { Push.getInstance().onMessageReceived(context, intent); } } }
PushReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (INTENT_ACTION_REGISTRATION.equals(action)) { String registrationId = intent.getStringExtra(INTENT_EXTRA_REGISTRATION); Push.getInstance().onTokenRefresh(registrationId); } else if (INTENT_ACTION_RECEIVE.equals(action)) { Push.getInstance().onMessageReceived(context, intent); } }  }
PushReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (INTENT_ACTION_REGISTRATION.equals(action)) { String registrationId = intent.getStringExtra(INTENT_EXTRA_REGISTRATION); Push.getInstance().onTokenRefresh(registrationId); } else if (INTENT_ACTION_RECEIVE.equals(action)) { Push.getInstance().onMessageReceived(context, intent); } }  @Override void onReceive(Context context, Intent intent); }
PushReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (INTENT_ACTION_REGISTRATION.equals(action)) { String registrationId = intent.getStringExtra(INTENT_EXTRA_REGISTRATION); Push.getInstance().onTokenRefresh(registrationId); } else if (INTENT_ACTION_RECEIVE.equals(action)) { Push.getInstance().onMessageReceived(context, intent); } }  @Override void onReceive(Context context, Intent intent);  }