Files
app_Settings/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java
Alexander Dorokhine 6decca7890 Migrate away from deprecated Truth APIs.
This is a transitional step towards truth 1.0.1, where these APIs have
been completely removed.

Bug: 168765701
Test: m checkbuild
Merged-In: I76f9c37cb699ce6ab8715ffe35d11668ccbceea1
Change-Id: I76f9c37cb699ce6ab8715ffe35d11668ccbceea1
(cherry picked from commit 46e85a2fad)
2020-10-06 00:25:04 -07:00

42 lines
1.2 KiB
Java

package com.android.settings.wifi;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.spy;
import android.content.Context;
import com.android.settings.testutils.XmlTestUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import java.util.List;
@RunWith(RobolectricTestRunner.class)
public class ConfigureWifiSettingsTest {
private Context mContext;
@Before
public void setUp() {
mContext = spy(RuntimeEnvironment.application);
}
@Test
@Config(qualifiers = "mcc999")
public void testNonIndexableKeys_ifPageDisabled_shouldNotIndexResource() {
final List<String> niks =
ConfigureWifiSettings.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(mContext);
final int xmlId = new ConfigureWifiSettings().getPreferenceScreenResId();
final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(mContext, xmlId);
assertThat(keys).isNotNull();
assertThat(niks).containsAtLeastElementsIn(keys);
}
}