Browse Source

Upgrade robolectric (#2664)

* Upgrade robolectric to 4.8.1

* Make TimelineDAO cleanup test deterministic
pull/2666/head
Levi Bard 4 years ago committed by GitHub
parent
commit
decd8a0f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/build.gradle
  2. 6
      app/src/test/java/com/keylesspalace/tusky/db/TimelineDaoTest.kt

2
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"

6
app/src/test/java/com/keylesspalace/tusky/db/TimelineDaoTest.kt

@ -101,7 +101,7 @@ class TimelineDaoTest {
assertStatuses(statusesAfterCleanup, loadedStatuses)
val loadedAccounts: MutableList<Pair<Long, String>> = 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"
)

Loading…
Cancel
Save