aboutsummaryrefslogtreecommitdiff
path: root/integration_tests/androidx_test/src/test/java/org/robolectric/integrationtests/axt/EspressoWithSwitchCompatTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'integration_tests/androidx_test/src/test/java/org/robolectric/integrationtests/axt/EspressoWithSwitchCompatTest.java')
-rw-r--r--integration_tests/androidx_test/src/test/java/org/robolectric/integrationtests/axt/EspressoWithSwitchCompatTest.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/integration_tests/androidx_test/src/test/java/org/robolectric/integrationtests/axt/EspressoWithSwitchCompatTest.java b/integration_tests/androidx_test/src/test/java/org/robolectric/integrationtests/axt/EspressoWithSwitchCompatTest.java
index 13f8fc252..a7606ce51 100644
--- a/integration_tests/androidx_test/src/test/java/org/robolectric/integrationtests/axt/EspressoWithSwitchCompatTest.java
+++ b/integration_tests/androidx_test/src/test/java/org/robolectric/integrationtests/axt/EspressoWithSwitchCompatTest.java
@@ -19,7 +19,9 @@ import org.robolectric.integration.axt.R;
public class EspressoWithSwitchCompatTest {
@Test
public void switchCompatTest() {
- ActivityScenario.launch(ActivityWithSwitchCompat.class);
- onView(withId(R.id.switch_compat_2)).check(matches(isCompletelyDisplayed())).perform(click());
+ try (ActivityScenario<ActivityWithSwitchCompat> scenario =
+ ActivityScenario.launch(ActivityWithSwitchCompat.class)) {
+ onView(withId(R.id.switch_compat_2)).check(matches(isCompletelyDisplayed())).perform(click());
+ }
}
}