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