Upgrade robolectric (#2664)
* Upgrade robolectric to 4.8.1 * Make TimelineDAO cleanup test deterministic
This commit is contained in:
parent
b21def5041
commit
decd8a0f4b
|
@ -185,7 +185,7 @@ dependencies {
|
||||||
implementation "com.github.UnifiedPush:android-connector:2.0.0"
|
implementation "com.github.UnifiedPush:android-connector:2.0.0"
|
||||||
|
|
||||||
testImplementation "androidx.test.ext:junit:1.1.3"
|
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:mockito-inline:4.4.0"
|
||||||
testImplementation "org.mockito.kotlin:mockito-kotlin:4.0.0"
|
testImplementation "org.mockito.kotlin:mockito-kotlin:4.0.0"
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ class TimelineDaoTest {
|
||||||
assertStatuses(statusesAfterCleanup, loadedStatuses)
|
assertStatuses(statusesAfterCleanup, loadedStatuses)
|
||||||
|
|
||||||
val loadedAccounts: MutableList<Pair<Long, String>> = mutableListOf()
|
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()
|
accountCursor.moveToFirst()
|
||||||
while (!accountCursor.isAfterLast) {
|
while (!accountCursor.isAfterLast) {
|
||||||
val accountId: Long = accountCursor.getLong(accountCursor.getColumnIndex("timelineUserId"))
|
val accountId: Long = accountCursor.getLong(accountCursor.getColumnIndex("timelineUserId"))
|
||||||
|
@ -111,10 +111,10 @@ class TimelineDaoTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
val expectedAccounts = listOf(
|
val expectedAccounts = listOf(
|
||||||
1L to "3",
|
|
||||||
1L to "10",
|
1L to "10",
|
||||||
1L to "R10",
|
|
||||||
1L to "20",
|
1L to "20",
|
||||||
|
1L to "3",
|
||||||
|
1L to "R10",
|
||||||
2L to "5"
|
2L to "5"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue