From b26b9561a10de7654678198cb650e8cd3211603c Mon Sep 17 00:00:00 2001 From: Robert Luo Date: Fri, 24 Apr 2020 17:38:52 +0800 Subject: [PATCH] Fix broken NfcAndPaymentFragment test case - searchIndexProvider_shouldIndexAllItems Bug: 154561690 Test: make RunSettingsRoboTests and pass all test cases in NfcAndPaymentFragmentTest Change-Id: I12f4901e4de01eb259f9daf3ac33b1e1879e98fd --- .../settings/connecteddevice/NfcAndPaymentFragmentTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/robotests/src/com/android/settings/connecteddevice/NfcAndPaymentFragmentTest.java b/tests/robotests/src/com/android/settings/connecteddevice/NfcAndPaymentFragmentTest.java index 6a151081578..46c9cbb2ab0 100644 --- a/tests/robotests/src/com/android/settings/connecteddevice/NfcAndPaymentFragmentTest.java +++ b/tests/robotests/src/com/android/settings/connecteddevice/NfcAndPaymentFragmentTest.java @@ -26,7 +26,6 @@ import android.nfc.NfcAdapter; import android.provider.SearchIndexableResource; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -63,8 +62,7 @@ public class NfcAndPaymentFragmentTest { } @Test - @Ignore - public void searchIndexProvider_shouldIndexAllItems() { + public void searchIndexProvider_shouldIndexValidItems() { when(mContext.getApplicationContext()).thenReturn(mContext); when(NfcAdapter.getDefaultAdapter(mContext)).thenReturn(mNfcAdapter); when(mNfcAdapter.isSecureNfcSupported()).thenReturn(true); @@ -73,6 +71,6 @@ public class NfcAndPaymentFragmentTest { .getNonIndexableKeys(mContext); assertThat(niks).isNotNull(); - assertThat(niks).isEmpty(); + assertThat(niks).containsExactly("nfc_detection_point"); } }