Reimplement contact search collection to support group access predicate.

This commit is contained in:
Alex Hart
2022-09-20 16:26:14 -03:00
committed by Cody Henthorne
parent 9dd96148d1
commit 1cea615675
10 changed files with 313 additions and 159 deletions

View File

@@ -28,4 +28,12 @@ abstract class MockCursor : Cursor {
return true
}
override fun isLast(): Boolean {
return _position == count - 1
}
override fun isAfterLast(): Boolean {
return _position >= count
}
}

View File

@@ -24,7 +24,7 @@ class ContactSearchPagedDataSourceTest {
@Before
fun setUp() {
whenever(repository.getRecipientFromGroupCursor(cursor)).thenReturn(Recipient.UNKNOWN)
whenever(repository.getRecipientFromGroupRecord(any())).thenReturn(Recipient.UNKNOWN)
whenever(repository.getRecipientFromRecipientCursor(cursor)).thenReturn(Recipient.UNKNOWN)
whenever(repository.getRecipientFromThreadCursor(cursor)).thenReturn(Recipient.UNKNOWN)
whenever(repository.getRecipientFromDistributionListCursor(cursor)).thenReturn(Recipient.UNKNOWN)
@@ -34,6 +34,8 @@ class ContactSearchPagedDataSourceTest {
whenever(cursor.moveToPosition(any())).thenCallRealMethod()
whenever(cursor.moveToNext()).thenCallRealMethod()
whenever(cursor.position).thenCallRealMethod()
whenever(cursor.isLast).thenCallRealMethod()
whenever(cursor.isAfterLast).thenCallRealMethod()
}
@Test