package io.michaelrocks.libphonenumber.android;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import io.michaelrocks.libphonenumber.android.sample.MainActivity;
import io.michaelrocks.libphonenumber.android.sample.R;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

@RunWith(AndroidJUnit4.class)
@LargeTest
public class MainActivityTest {

  @Rule
  public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class);

  @Test
  public void checkTextViewContainsEnabledFeatures() {
    onView(withId(R.id.button))
        .perform(click());
    onView(withId(R.id.textView))
        .check(matches(withText("+1 800-555-1212")));
  }
}

@@ -122,16 +122,75 @@
 nWith;%0A%0A
+import androidx.test.ext.junit.rules.ActivityScenarioRule;%0A
 import a
@@ -279,52 +279,8 @@
 st;%0A
-import androidx.test.rule.ActivityTestRule;%0A
 impo
@@ -817,28 +817,32 @@
 lic Activity
-Test
+Scenario
 Rule%3CMainAct
@@ -867,20 +867,24 @@
 Activity
-Test
+Scenario
 Rule%3C%3E(M

Fix a deprecation warning