From 4d84286ea7d571d16869c3907de308f0a8d2b5a4 Mon Sep 17 00:00:00 2001 From: Govinda Wasserman Date: Wed, 5 Apr 2023 08:25:00 -0400 Subject: Removes dependency on TestNG library. This library does not play well with some parts of Android including Android Studio support. This change replaces the usages with supported versions. BUG:278726409 Change-Id: I970e6af31853382454f35eeff70a7f92e2f28e5a --- java/tests/Android.bp | 1 - java/tests/src/com/android/intentresolver/ResolverActivityTest.java | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'java') diff --git a/java/tests/Android.bp b/java/tests/Android.bp index 12cb390e..c381d0a8 100644 --- a/java/tests/Android.bp +++ b/java/tests/Android.bp @@ -29,7 +29,6 @@ android_test { "androidx.lifecycle_lifecycle-runtime-ktx", "truth-prebuilt", "testables", - "testng", "kotlinx_coroutines_test", ], test_suites: ["general-tests"], diff --git a/java/tests/src/com/android/intentresolver/ResolverActivityTest.java b/java/tests/src/com/android/intentresolver/ResolverActivityTest.java index 12b71970..5cece092 100644 --- a/java/tests/src/com/android/intentresolver/ResolverActivityTest.java +++ b/java/tests/src/com/android/intentresolver/ResolverActivityTest.java @@ -33,10 +33,10 @@ import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.fail; import android.content.Intent; import android.content.pm.ResolveInfo; @@ -510,7 +510,7 @@ public class ResolverActivityTest { waitForIdle(); TextView headerText = activity.findViewById(com.android.internal.R.id.title); String initialText = headerText.getText().toString(); - assertFalse(initialText.isEmpty(), "Header text is empty."); + assertFalse("Header text is empty.", initialText.isEmpty()); assertThat(headerText.getVisibility(), is(View.VISIBLE)); } -- cgit v1.2.3-59-g8ed1b