Add example of google truth in a non robolectric test

Change-Id: I6549ae01b31df39462d252e767fc3255b05813fe
Fixes: 34277648
Test: make SettingsUnitTests, make RunSettingsRoboTests
This commit is contained in:
Matthew Fritze
2017-01-13 12:43:00 -08:00
parent 1c6f9de1a1
commit 1212b0ea3f

View File

@@ -32,8 +32,7 @@ import org.junit.runner.RunWith;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static com.google.common.truth.Truth.assertThat;
@SmallTest
@RunWith(AndroidJUnit4.class)
@@ -47,7 +46,8 @@ public class SearchActivityTest {
final List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(
intent, PackageManager.GET_META_DATA);
assertFalse(resolveInfos.isEmpty());
assertEquals(Settings.class.getName(), resolveInfos.get(0).activityInfo.parentActivityName);
assertThat(resolveInfos).isNotEmpty();
assertThat(resolveInfos.get(0).activityInfo.parentActivityName)
.isEqualTo(Settings.class.getName());
}
}