Reorder TestPager constructor parameters
Reorderd to intuitively match constructor parameter of real Pager
Test: ./gradlew paging:paging-testing:test
Bug: n/a
Relnote: "Reordered TestPager constructor parameters to intuitively match the order of real Pager constructor parameters"
Change-Id: I6185ad09fb5e695c02b50f88022d168405de39f2
diff --git a/paging/paging-testing/api/current.txt b/paging/paging-testing/api/current.txt
index 91eeba55..62159d25 100644
--- a/paging/paging-testing/api/current.txt
+++ b/paging/paging-testing/api/current.txt
@@ -31,7 +31,7 @@
}
public final class TestPager<Key, Value> {
- ctor public TestPager(androidx.paging.PagingSource<Key,Value> pagingSource, androidx.paging.PagingConfig config);
+ ctor public TestPager(androidx.paging.PagingConfig config, androidx.paging.PagingSource<Key,Value> pagingSource);
method public suspend Object? append(kotlin.coroutines.Continuation<androidx.paging.PagingSource.LoadResult<Key,Value>>);
method public suspend Object? getLastLoadedPage(kotlin.coroutines.Continuation<androidx.paging.PagingSource.LoadResult.Page<Key,Value>>);
method public suspend Object? getPages(kotlin.coroutines.Continuation<java.util.List<androidx.paging.PagingSource.LoadResult.Page<Key,Value>>>);
diff --git a/paging/paging-testing/api/public_plus_experimental_current.txt b/paging/paging-testing/api/public_plus_experimental_current.txt
index 91eeba55..62159d25 100644
--- a/paging/paging-testing/api/public_plus_experimental_current.txt
+++ b/paging/paging-testing/api/public_plus_experimental_current.txt
@@ -31,7 +31,7 @@
}
public final class TestPager<Key, Value> {
- ctor public TestPager(androidx.paging.PagingSource<Key,Value> pagingSource, androidx.paging.PagingConfig config);
+ ctor public TestPager(androidx.paging.PagingConfig config, androidx.paging.PagingSource<Key,Value> pagingSource);
method public suspend Object? append(kotlin.coroutines.Continuation<androidx.paging.PagingSource.LoadResult<Key,Value>>);
method public suspend Object? getLastLoadedPage(kotlin.coroutines.Continuation<androidx.paging.PagingSource.LoadResult.Page<Key,Value>>);
method public suspend Object? getPages(kotlin.coroutines.Continuation<java.util.List<androidx.paging.PagingSource.LoadResult.Page<Key,Value>>>);
diff --git a/paging/paging-testing/api/restricted_current.txt b/paging/paging-testing/api/restricted_current.txt
index 91eeba55..62159d25 100644
--- a/paging/paging-testing/api/restricted_current.txt
+++ b/paging/paging-testing/api/restricted_current.txt
@@ -31,7 +31,7 @@
}
public final class TestPager<Key, Value> {
- ctor public TestPager(androidx.paging.PagingSource<Key,Value> pagingSource, androidx.paging.PagingConfig config);
+ ctor public TestPager(androidx.paging.PagingConfig config, androidx.paging.PagingSource<Key,Value> pagingSource);
method public suspend Object? append(kotlin.coroutines.Continuation<androidx.paging.PagingSource.LoadResult<Key,Value>>);
method public suspend Object? getLastLoadedPage(kotlin.coroutines.Continuation<androidx.paging.PagingSource.LoadResult.Page<Key,Value>>);
method public suspend Object? getPages(kotlin.coroutines.Continuation<java.util.List<androidx.paging.PagingSource.LoadResult.Page<Key,Value>>>);
diff --git a/paging/paging-testing/src/main/java/androidx/paging/testing/TestPager.kt b/paging/paging-testing/src/main/java/androidx/paging/testing/TestPager.kt
index 85e3efb..e650e77 100644
--- a/paging/paging-testing/src/main/java/androidx/paging/testing/TestPager.kt
+++ b/paging/paging-testing/src/main/java/androidx/paging/testing/TestPager.kt
@@ -41,12 +41,12 @@
* multi-generational Paging behavior, you must create a new [TestPager] by supplying a
* new instance of [PagingSource].
*
- * @param pagingSource the [PagingSource] to load data from.
* @param config the [PagingConfig] to configure this TestPager's loading behavior.
+ * @param pagingSource the [PagingSource] to load data from.
*/
public class TestPager<Key : Any, Value : Any>(
- private val pagingSource: PagingSource<Key, Value>,
private val config: PagingConfig,
+ private val pagingSource: PagingSource<Key, Value>,
) {
private val hasRefreshed = AtomicBoolean(false)
diff --git a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt b/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt
index c293ed0..c327ff5 100644
--- a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt
+++ b/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt
@@ -50,7 +50,7 @@
val factory: PagingSourceFactory<Int, Int> =
flowOf<List<Int>>().asPagingSourceFactory(testScope)
val pagingSource = factory()
- val pager = TestPager(pagingSource, CONFIG)
+ val pager = TestPager(CONFIG, pagingSource)
runTest {
val result = pager.refresh() as Page
@@ -67,7 +67,7 @@
val factory: PagingSourceFactory<Int, Int> =
flow.asPagingSourceFactory(testScope)
val pagingSource = factory()
- val pager = TestPager(pagingSource, CONFIG)
+ val pager = TestPager(CONFIG, pagingSource)
runTest {
val result = pager.refresh() as Page
@@ -92,7 +92,7 @@
// first gen
val pagingSource1 = factory()
- val pager1 = TestPager(pagingSource1, CONFIG)
+ val pager1 = TestPager(CONFIG, pagingSource1)
val result1 = pager1.refresh() as Page
assertThat(result1.data).containsExactlyElementsIn(
listOf(0, 1, 2, 3, 4)
@@ -105,7 +105,7 @@
// second gen
val pagingSource2 = factory()
- val pager2 = TestPager(pagingSource2, CONFIG)
+ val pager2 = TestPager(CONFIG, pagingSource2)
val result2 = pager2.refresh() as Page
assertThat(result2.data).containsExactlyElementsIn(
listOf(30, 31, 32, 33, 34)
@@ -125,7 +125,7 @@
advanceUntilIdle()
val pagingSource = factory()
- val pager = TestPager(pagingSource, CONFIG)
+ val pager = TestPager(CONFIG, pagingSource)
val result = pager.refresh() as Page
assertThat(result.data).containsExactlyElementsIn(
listOf(0, 1, 2, 3, 4)
@@ -158,7 +158,7 @@
// factory 1 first gen
val pagingSource = factory1()
- val pager = TestPager(pagingSource, CONFIG)
+ val pager = TestPager(CONFIG, pagingSource)
val result = pager.refresh() as Page
assertThat(result.data).containsExactlyElementsIn(
listOf(0, 1, 2, 3, 4)
@@ -166,7 +166,7 @@
// factory 2 first gen
val pagingSource2 = factory2()
- val pager2 = TestPager(pagingSource2, CONFIG)
+ val pager2 = TestPager(CONFIG, pagingSource2)
val result2 = pager2.refresh() as Page
assertThat(result2.data).containsExactlyElementsIn(
listOf(0, 1, 2, 3, 4)
@@ -182,7 +182,7 @@
// factory 1 second gen
val pagingSource3 = factory1()
- val pager3 = TestPager(pagingSource3, CONFIG)
+ val pager3 = TestPager(CONFIG, pagingSource3)
val result3 = pager3.refresh() as Page
assertThat(result3.data).containsExactlyElementsIn(
listOf(30, 31, 32, 33, 34)
@@ -190,7 +190,7 @@
// factory 2 second gen
val pagingSource4 = factory2()
- val pager4 = TestPager(pagingSource4, CONFIG)
+ val pager4 = TestPager(CONFIG, pagingSource4)
val result4 = pager4.refresh() as Page
assertThat(result4.data).containsExactlyElementsIn(
listOf(30, 31, 32, 33, 34)
@@ -203,14 +203,14 @@
val factory = data.asPagingSourceFactory()
val pagingSource1 = factory()
- val pager1 = TestPager(pagingSource1, CONFIG)
+ val pager1 = TestPager(CONFIG, pagingSource1)
val refresh1 = pager1.refresh() as Page
assertThat(refresh1.data).containsExactlyElementsIn(
listOf(0, 1, 2, 3, 4)
)
val pagingSource2 = factory()
- val pager2 = TestPager(pagingSource2, CONFIG)
+ val pager2 = TestPager(CONFIG, pagingSource2)
val refresh2 = pager2.refresh() as Page
assertThat(refresh2.data).containsExactlyElementsIn(
listOf(0, 1, 2, 3, 4)
@@ -223,12 +223,12 @@
val factory = data.asPagingSourceFactory()
val pagingSource1 = factory()
- val pager1 = TestPager(pagingSource1, CONFIG)
+ val pager1 = TestPager(CONFIG, pagingSource1)
val refresh1 = pager1.refresh() as Page
assertThat(refresh1.data).isEmpty()
val pagingSource2 = factory()
- val pager2 = TestPager(pagingSource2, CONFIG)
+ val pager2 = TestPager(CONFIG, pagingSource2)
val refresh2 = pager2.refresh() as Page
assertThat(refresh2.data).isEmpty()
}
@@ -238,7 +238,7 @@
val data = List(20) { it }
val factory = data.asPagingSourceFactory()
val pagingSource1 = factory()
- val pager1 = TestPager(pagingSource1, CONFIG)
+ val pager1 = TestPager(CONFIG, pagingSource1)
pager1.refresh() as Page
pager1.append()
@@ -257,7 +257,7 @@
val data = List(20) { it }
val factory = data.asPagingSourceFactory()
val pagingSource1 = factory()
- val pager1 = TestPager(pagingSource1, CONFIG)
+ val pager1 = TestPager(CONFIG, pagingSource1)
pager1.refresh(initialKey = 10) as Page
pager1.prepend()
diff --git a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceTest.kt b/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceTest.kt
index 0ab9d08..e93e9d9 100644
--- a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceTest.kt
+++ b/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceTest.kt
@@ -271,7 +271,7 @@
@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)
private fun runPagingSourceTest(
source: PagingSource<Int, Int> = StaticListPagingSource(DATA),
- pager: TestPager<Int, Int> = TestPager(source, CONFIG),
+ pager: TestPager<Int, Int> = TestPager(CONFIG, source),
block: suspend (pagingSource: PagingSource<Int, Int>, pager: TestPager<Int, Int>) -> Unit
) {
runTest {
diff --git a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/TestPagerTest.kt b/paging/paging-testing/src/test/kotlin/androidx/paging/testing/TestPagerTest.kt
index 72b5b48..6caaea9 100644
--- a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/TestPagerTest.kt
+++ b/paging/paging-testing/src/test/kotlin/androidx/paging/testing/TestPagerTest.kt
@@ -39,7 +39,7 @@
@Test
fun refresh_nullKey() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
val result = pager.refresh(null) as LoadResult.Page
@@ -51,7 +51,7 @@
@Test
fun refresh_withInitialKey() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
val result = pager.refresh(50) as LoadResult.Page
@@ -63,7 +63,7 @@
@Test
fun refresh_returnError() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
source.errorNextLoad = true
@@ -78,7 +78,7 @@
@Test
fun refresh_returnInvalid() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
source.nextLoadResult = LoadResult.Invalid()
@@ -93,7 +93,7 @@
@Test
fun refresh_invalidPagingSource() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
source.invalidate()
@@ -108,7 +108,7 @@
@Test
fun refresh_getLastLoadedPage() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
val page: LoadResult.Page<Int, Int>? = pager.run {
@@ -123,7 +123,7 @@
@Test
fun getLastLoadedPage_afterInvalidPagingSource() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
val page = pager.run {
@@ -141,7 +141,7 @@
@Test
fun refresh_getPages() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
val pages = pager.run {
@@ -160,7 +160,7 @@
@Test
fun getPages_multiplePages() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
pager.run {
refresh(20)
@@ -179,7 +179,7 @@
@Test
fun getPages_fromEmptyList() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
val pages = pager.getPages()
assertThat(pages).isEmpty()
}
@@ -187,7 +187,7 @@
@Test
fun getPages_afterInvalidPagingSource() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
val pages = pager.run {
@@ -209,7 +209,7 @@
@Test
fun getPages_multiThread() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
var pages: List<LoadResult.Page<Int, Int>>? = null
val job = launch {
@@ -250,7 +250,7 @@
@Test
fun multipleRefresh_onSinglePager_throws() {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
runTest {
pager.run {
@@ -269,7 +269,7 @@
@Test
fun multipleRefresh_onMultiplePagers() = runTest {
val source1 = TestPagingSource()
- val pager1 = TestPager(source1, CONFIG)
+ val pager1 = TestPager(CONFIG, source1)
// first gen
val result1 = pager1.run {
@@ -280,7 +280,7 @@
// second gen
val source2 = TestPagingSource()
- val pager2 = TestPager(source2, CONFIG)
+ val pager2 = TestPager(CONFIG, source2)
val result2 = pager2.run {
refresh()
@@ -292,7 +292,7 @@
@Test
fun simpleAppend() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
val result = pager.run {
refresh(null)
@@ -311,7 +311,7 @@
@Test
fun simplePrepend() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
val result = pager.run {
refresh(30)
@@ -333,7 +333,7 @@
@Test
fun append_beforeRefresh_throws() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
assertFailsWith<IllegalStateException> {
pager.append()
}
@@ -342,7 +342,7 @@
@Test
fun prepend_beforeRefresh_throws() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
assertFailsWith<IllegalStateException> {
pager.prepend()
}
@@ -351,7 +351,7 @@
@Test
fun append_invalidPagingSource() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
val result = pager.run {
refresh()
@@ -367,7 +367,7 @@
@Test
fun prepend_invalidPagingSource() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
val result = pager.run {
refresh(initialKey = 20)
@@ -383,7 +383,7 @@
@Test
fun consecutive_append() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
pager.run {
refresh(20)
@@ -403,7 +403,7 @@
@Test
fun consecutive_prepend() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
pager.run {
refresh(20)
@@ -427,7 +427,7 @@
@Test
fun append_then_prepend() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
pager.run {
refresh(20)
@@ -450,7 +450,7 @@
@Test
fun prepend_then_append() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
pager.run {
refresh(20)
@@ -473,7 +473,7 @@
@Test
fun multiThread_loads() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
// load operations upon completion add an int to the list.
// after all loads complete, we assert the order that the ints were added.
val loadOrder = mutableListOf<Int>()
@@ -511,7 +511,7 @@
@Test
fun multiThread_operations() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
// operations upon completion add an int to the list.
// after all operations complete, we assert the order that the ints were added.
val loadOrder = mutableListOf<Int>()
@@ -559,7 +559,7 @@
@Test
fun getPagingStateWithAnchorPosition_placeHoldersEnabled() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
val state = pager.run {
refresh(20)
@@ -583,7 +583,7 @@
)
)
val source2 = TestPagingSource()
- val pager2 = TestPager(source, CONFIG)
+ val pager2 = TestPager(CONFIG, source)
val page = pager2.run {
refresh(source2.getRefreshKey(state))
}
@@ -598,7 +598,7 @@
initialLoadSize = 5,
enablePlaceholders = false
)
- val pager = TestPager(source, config)
+ val pager = TestPager(config, source)
val state = pager.run {
refresh(20)
@@ -621,7 +621,7 @@
)
)
val source2 = TestPagingSource()
- val pager2 = TestPager(source, CONFIG)
+ val pager2 = TestPager(CONFIG, source)
val page = pager2.run {
refresh(source2.getRefreshKey(state))
}
@@ -634,7 +634,7 @@
@Test
fun getPagingStateWithAnchorPosition_indexOutOfBoundsWithPlaceholders() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
val msg = assertFailsWith<IllegalStateException> {
pager.run {
@@ -661,12 +661,12 @@
fun getPagingStateWithAnchorPosition_indexOutOfBoundsWithoutPlaceholders() = runTest {
val source = TestPagingSource()
val pager = TestPager(
- source,
PagingConfig(
pageSize = 3,
initialLoadSize = 5,
enablePlaceholders = false
- )
+ ),
+ source
)
val msg = assertFailsWith<IllegalStateException> {
@@ -694,7 +694,7 @@
@Test
fun getPagingStateWithAnchorLookup_placeHoldersEnabled() = runTest {
val source = TestPagingSource()
- val pager = TestPager(source, CONFIG)
+ val pager = TestPager(CONFIG, source)
val state = pager.run {
refresh(20)
@@ -718,7 +718,7 @@
)
// use state to getRefreshKey
val source2 = TestPagingSource()
- val pager2 = TestPager(source, CONFIG)
+ val pager2 = TestPager(CONFIG, source)
val page = pager2.run {
refresh(source2.getRefreshKey(state))
}
@@ -733,7 +733,7 @@
initialLoadSize = 5,
enablePlaceholders = false
)
- val pager = TestPager(source, config)
+ val pager = TestPager(config, source)
val state = pager.run {
refresh(20)
@@ -757,7 +757,7 @@
)
// use state to getRefreshKey
val source2 = TestPagingSource()
- val pager2 = TestPager(source, CONFIG)
+ val pager2 = TestPager(CONFIG, source)
val page = pager2.run {
refresh(source2.getRefreshKey(state))
}
@@ -775,7 +775,7 @@
initialLoadSize = 5,
enablePlaceholders = false
)
- val pager = TestPager(source, config)
+ val pager = TestPager(config, source)
val msg = assertFailsWith<IllegalArgumentException> {
pager.run {
@@ -801,7 +801,7 @@
enablePlaceholders = false,
maxSize = 10
)
- val pager = TestPager(source, config)
+ val pager = TestPager(config, source)
pager.run {
refresh(20)
prepend()
@@ -833,7 +833,7 @@
enablePlaceholders = false,
maxSize = 10
)
- val pager = TestPager(source, config)
+ val pager = TestPager(config, source)
pager.run {
refresh(20)
append()
@@ -864,7 +864,7 @@
enablePlaceholders = false,
maxSize = 10
)
- val pager = TestPager(source, config)
+ val pager = TestPager(config, source)
pager.run {
refresh(20)
append()
@@ -896,7 +896,7 @@
maxSize = 5,
prefetchDistance = 2
)
- val pager = TestPager(source, config)
+ val pager = TestPager(config, source)
pager.refresh(20)
assertThat(pager.getPages()).containsExactlyElementsIn(
listOf(
@@ -931,7 +931,7 @@
maxSize = 3,
prefetchDistance = 1
)
- val pager = TestPager(source, config)
+ val pager = TestPager(config, source)
val result = pager.refresh() as LoadResult.Page
assertThat(result.data).containsExactlyElementsIn(
listOf(0, 1, 2, 3, 4)
diff --git a/room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt b/room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
index 09a9564..e4bcd8b 100644
--- a/room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
+++ b/room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
@@ -573,7 +573,7 @@
val refreshKey = 85 - (15 / 2)
val pagingSource2 = LimitOffsetPagingSourceImpl(database)
- val pager2 = TestPager(pagingSource2, CONFIG)
+ val pager2 = TestPager(CONFIG, pagingSource2)
val result = pager2.refresh(initialKey = refreshKey) as LoadResult.Page
// database should only have 40 items left. Refresh key is invalid at this point
@@ -616,7 +616,7 @@
dao.deleteTestItems(0, 29)
val pagingSource2 = LimitOffsetPagingSourceImpl(database)
- val pager2 = TestPager(pagingSource2, CONFIG)
+ val pager2 = TestPager(CONFIG, pagingSource2)
// assume user was viewing first few items with anchorPosition = 0 and refresh key
// clips to 0
val result = pager2.refresh(initialKey = 0) as LoadResult.Page
@@ -648,7 +648,7 @@
dao.deleteTestItems(0, 94)
val pagingSource2 = LimitOffsetPagingSourceImpl(database)
- val pager2 = TestPager(pagingSource2, CONFIG)
+ val pager2 = TestPager(CONFIG, pagingSource2)
// assume user was viewing first few items with anchorPosition = 0 and refresh key
// clips to 0
val result = pager2.refresh(initialKey = 0) as LoadResult.Page
@@ -682,7 +682,7 @@
) -> Unit
) {
runBlocking {
- block(TestPager(pagingSource, config), pagingSource)
+ block(TestPager(config, pagingSource), pagingSource)
}
}
}
@@ -736,7 +736,7 @@
@Test
fun invalid_append() = runTest {
val pagingSource = LimitOffsetPagingSourceImpl(db)
- val pager = TestPager(pagingSource, CONFIG)
+ val pager = TestPager(CONFIG, pagingSource)
dao.addAllItems(ITEMS_LIST)
val result = pager.refresh() as LoadResult.Page
@@ -769,7 +769,7 @@
@Test
fun invalid_prepend() = runTest {
val pagingSource = LimitOffsetPagingSourceImpl(db)
- val pager = TestPager(pagingSource, CONFIG)
+ val pager = TestPager(CONFIG, pagingSource)
dao.addAllItems(ITEMS_LIST)
val result = pager.refresh(initialKey = 20) as LoadResult.Page