SmsReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "onReceive("+intent+")"); if (isSmsBackupDefaultSmsApp(context)) { final SmsMessage[] messages = getMessagesFromIntent(intent); if (messages != null && messages.length > 0) { storeMessage(context, messages); } } }  @Override void onReceive(Context context, Intent intent); static boolean isSmsBackupDefaultSmsApp(@NonNull Context context); static void enable(Context context); static void disable(Context context);  }
@Test @Config(sdk = Build.VERSION_CODES.JELLY_BEAN) public void testOnReceivePreKitKat() { subject.onReceive(RuntimeEnvironment.application, new Intent()); }
@Test @Config(sdk = Build.VERSION_CODES.KITKAT) public void testOnReceiveKitKat() { subject.onReceive(RuntimeEnvironment.application, new Intent()); }