public void searchForAddOns() {
    mDialogController.showDialog(LEAVE);
  }
@Test
  public void testSearchHappyPath() {
    Application context = ApplicationProvider.getApplicationContext();
    ShadowApplication shadowApplication = Shadows.shadowOf(context);

    final AddOnStoreSearchController underTest = new AddOnStoreSearchController(context, "add on");

    underTest.searchForAddOns();

    var leaveDialog = GeneralDialogTestUtil.getLatestShownDialog();
    Assert.assertEquals(
        "Leaving AnySoftKeyboard", GeneralDialogTestUtil.getTitleFromDialog(leaveDialog));

    var button = leaveDialog.getButton(DialogInterface.BUTTON_POSITIVE);
    Shadows.shadowOf(button).getOnClickListener().onClick(button);

    Assert.assertSame(
        GeneralDialogTestUtil.NO_DIALOG, GeneralDialogTestUtil.getLatestShownDialog());

    var intent = shadowApplication.getNextStartedActivity();
    Assert.assertEquals(Intent.ACTION_VIEW, intent.getAction());
    Assert.assertEquals(
        Uri.parse("market://search?q=AnySoftKeyboard%20add%20on"), intent.getData());
  }