@Test
  public void testIntentActionScanBarcode() {
    activityTestRule.launchActivity(new Intent(AuthenticatorActivity.ACTION_SCAN_BARCODE));
    Intent expectedIntent =
        AuthenticatorActivity.getLaunchIntentActionScanBarcode(
            activityTestRule.getActivity(), false);
    intended(
        allOf(
            hasAction(AuthenticatorActivity.ACTION_SCAN_BARCODE),
            hasComponent(equalTo(expectedIntent.getComponent()))));
    assertThat(TestUtilities.isStrayIntentRemaining()).isFalse();
  }
Unit tests for {@link AuthenticatorActivity} (part/shard 1).
javatests/com/google/android/apps/authenticator/AuthenticatorActivityTest.java