Update Robolectric tests to use google truth

Bug: 31545801
Test: make RunSettingsRoboTests
Change-Id: Idb801d51b6a4dc02ea062bc32086e1a8fc28b94b
This commit is contained in:
Matthew Fritze
2016-09-16 11:14:33 -07:00
parent e590183dcc
commit 9a3dc4e2a8
7 changed files with 76 additions and 79 deletions

View File

@@ -23,9 +23,8 @@ import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static com.google.common.truth.Truth.assertThat;
@RunWith(RobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@@ -33,10 +32,10 @@ public class ThreadUtilsTest {
@Test
public void testMainThread() throws InterruptedException {
assertTrue(ThreadUtils.isMainThread());
assertThat(ThreadUtils.isMainThread()).isTrue();
Thread background = new Thread(new Runnable() {
public void run() {
assertFalse(ThreadUtils.isMainThread());
assertThat(ThreadUtils.isMainThread()).isFalse();
}
});
background.start();