Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 20de5fa

Browse files
committed
Update Paging sample test to kotlinx.coroutines.test 1.6
1 parent 79e64a6 commit 20de5fa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

PagingWithNetworkSample/app/src/test/java/com/android/example/paging/pagingwithnetwork/reddit/repository/SubredditPagingSourceTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import com.android.example.paging.pagingwithnetwork.reddit.repository.inMemory.b
88
import com.android.example.paging.pagingwithnetwork.repository.FakeRedditApi
99
import com.android.example.paging.pagingwithnetwork.repository.PostFactory
1010
import kotlinx.coroutines.ExperimentalCoroutinesApi
11-
import kotlinx.coroutines.test.runBlockingTest
11+
import kotlinx.coroutines.test.runTest
1212
import org.junit.Test
1313
import kotlin.test.assertEquals
1414

@@ -25,7 +25,7 @@ class SubredditPagingSourceTest {
2525
}
2626

2727
@Test
28-
fun itemKeyedSubredditPagingSource() = runBlockingTest {
28+
fun itemKeyedSubredditPagingSource() = runTest {
2929
val pagingSource = ItemKeyedSubredditPagingSource(fakeApi, DEFAULT_SUBREDDIT)
3030
assertEquals(
3131
expected = Page(
@@ -44,7 +44,7 @@ class SubredditPagingSourceTest {
4444
}
4545

4646
@Test
47-
fun pageKeyedSubredditPagingSource() = runBlockingTest {
47+
fun pageKeyedSubredditPagingSource() = runTest {
4848
val pagingSource = PageKeyedSubredditPagingSource(fakeApi, DEFAULT_SUBREDDIT)
4949
assertEquals(
5050
expected = Page(

PagingWithNetworkSample/versions.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ versions.benchmark = "1.1.0-alpha01"
3535
versions.cardview = "1.0.0"
3636
versions.constraint_layout = "2.0.0-alpha2"
3737
versions.core_ktx = "1.1.0"
38-
versions.coroutines = "1.4.1"
38+
versions.coroutines = "1.6.0"
3939
versions.dagger = "2.16"
4040
versions.dexmaker = "2.2.0"
4141
versions.espresso = "3.2.0"
4242
versions.fragment = "1.2.0"
4343
versions.glide = "4.8.0"
4444
versions.hamcrest = "1.3"
4545
versions.junit = "4.12"
46-
versions.kotlin = "1.4.21"
46+
versions.kotlin = "1.6.10"
4747
versions.lifecycle = "2.2.0"
4848
versions.material = "1.0.0"
4949
versions.mockito = "2.25.0"

0 commit comments

Comments
 (0)