From decd8a0f4bb7e206e71a647dbc2bef70b2ad1ab7 Mon Sep 17 00:00:00 2001 From: Levi Bard Date: Mon, 15 Aug 2022 11:01:17 +0200 Subject: [PATCH] Upgrade robolectric (#2664) * Upgrade robolectric to 4.8.1 * Make TimelineDAO cleanup test deterministic --- app/build.gradle | 2 +- .../test/java/com/keylesspalace/tusky/db/TimelineDaoTest.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d44a12f4b..bbcde3ab3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -185,7 +185,7 @@ dependencies { implementation "com.github.UnifiedPush:android-connector:2.0.0" testImplementation "androidx.test.ext:junit:1.1.3" - testImplementation "org.robolectric:robolectric:4.4" + testImplementation "org.robolectric:robolectric:4.8.1" testImplementation "org.mockito:mockito-inline:4.4.0" testImplementation "org.mockito.kotlin:mockito-kotlin:4.0.0" diff --git a/app/src/test/java/com/keylesspalace/tusky/db/TimelineDaoTest.kt b/app/src/test/java/com/keylesspalace/tusky/db/TimelineDaoTest.kt index 620f73403..b629f9d86 100644 --- a/app/src/test/java/com/keylesspalace/tusky/db/TimelineDaoTest.kt +++ b/app/src/test/java/com/keylesspalace/tusky/db/TimelineDaoTest.kt @@ -101,7 +101,7 @@ class TimelineDaoTest { assertStatuses(statusesAfterCleanup, loadedStatuses) val loadedAccounts: MutableList> = mutableListOf() - val accountCursor = db.query("SELECT timelineUserId, serverId FROM TimelineAccountEntity", null) + val accountCursor = db.query("SELECT timelineUserId, serverId FROM TimelineAccountEntity ORDER BY timelineUserId, serverId", null) accountCursor.moveToFirst() while (!accountCursor.isAfterLast) { val accountId: Long = accountCursor.getLong(accountCursor.getColumnIndex("timelineUserId")) @@ -111,10 +111,10 @@ class TimelineDaoTest { } val expectedAccounts = listOf( - 1L to "3", 1L to "10", - 1L to "R10", 1L to "20", + 1L to "3", + 1L to "R10", 2L to "5" )