mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-27 04:04:43 +01:00
Renamed database classes to table classes.
Because they're not databases. They're tables.
This commit is contained in:
committed by
Cody Henthorne
parent
b190f9495a
commit
7949996c5c
@@ -27,8 +27,8 @@ import org.signal.storageservice.protos.groups.local.DecryptedGroup
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedMember
|
||||
import org.thoughtcrime.securesms.SignalStoreRule
|
||||
import org.thoughtcrime.securesms.TestZkGroupServer
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase
|
||||
import org.thoughtcrime.securesms.database.GroupStateTestData
|
||||
import org.thoughtcrime.securesms.database.GroupTable
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.member
|
||||
import org.thoughtcrime.securesms.groups.v2.GroupCandidateHelper
|
||||
import org.thoughtcrime.securesms.groups.v2.processing.GroupsV2StateProcessor
|
||||
@@ -62,7 +62,7 @@ class GroupManagerV2Test_edit {
|
||||
val others: List<DecryptedMember> = listOf(member(otherSid))
|
||||
}
|
||||
|
||||
private lateinit var groupDatabase: GroupDatabase
|
||||
private lateinit var groupTable: GroupTable
|
||||
private lateinit var groupsV2API: GroupsV2Api
|
||||
private lateinit var groupsV2Operations: GroupsV2Operations
|
||||
private lateinit var groupsV2Authorization: GroupsV2Authorization
|
||||
@@ -87,7 +87,7 @@ class GroupManagerV2Test_edit {
|
||||
|
||||
val clientZkOperations = ClientZkOperations(server.getServerPublicParams())
|
||||
|
||||
groupDatabase = mock(GroupDatabase::class.java)
|
||||
groupTable = mock(GroupTable::class.java)
|
||||
groupsV2API = mock(GroupsV2Api::class.java)
|
||||
groupsV2Operations = GroupsV2Operations(clientZkOperations, 1000)
|
||||
groupsV2Authorization = mock(GroupsV2Authorization::class.java)
|
||||
@@ -100,7 +100,7 @@ class GroupManagerV2Test_edit {
|
||||
|
||||
manager = GroupManagerV2(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
groupDatabase,
|
||||
groupTable,
|
||||
groupsV2API,
|
||||
groupsV2Operations,
|
||||
groupsV2Authorization,
|
||||
@@ -115,8 +115,8 @@ class GroupManagerV2Test_edit {
|
||||
val data = GroupStateTestData(masterKey, groupOperations)
|
||||
data.init()
|
||||
|
||||
Mockito.doReturn(data.groupRecord).`when`(groupDatabase).getGroup(groupId)
|
||||
Mockito.doReturn(data.groupRecord.get()).`when`(groupDatabase).requireGroup(groupId)
|
||||
Mockito.doReturn(data.groupRecord).`when`(groupTable).getGroup(groupId)
|
||||
Mockito.doReturn(data.groupRecord.get()).`when`(groupTable).requireGroup(groupId)
|
||||
|
||||
Mockito.doReturn(GroupManagerV2.RecipientAndThread(Recipient.UNKNOWN, 1)).`when`(sendGroupUpdateHelper).sendGroupUpdate(Mockito.eq(masterKey), Mockito.any(), Mockito.any(), Mockito.anyBoolean())
|
||||
|
||||
@@ -128,7 +128,7 @@ class GroupManagerV2Test_edit {
|
||||
}
|
||||
|
||||
private fun then(then: (DecryptedGroup) -> Unit) {
|
||||
Mockito.verify(groupDatabase).update(Mockito.eq(groupId), patchedDecryptedGroup.capture())
|
||||
Mockito.verify(groupTable).update(Mockito.eq(groupId), patchedDecryptedGroup.capture())
|
||||
then(patchedDecryptedGroup.value)
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ import org.signal.storageservice.protos.groups.local.DecryptedMember
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedString
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedTimer
|
||||
import org.thoughtcrime.securesms.SignalStoreRule
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase
|
||||
import org.thoughtcrime.securesms.database.GroupStateTestData
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase
|
||||
import org.thoughtcrime.securesms.database.GroupTable
|
||||
import org.thoughtcrime.securesms.database.RecipientTable
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.DecryptedGroupV2Context
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.member
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.requestingMember
|
||||
@@ -72,8 +72,8 @@ class GroupsV2StateProcessorTest {
|
||||
private val others: List<DecryptedMember> = listOf(member(otherSid))
|
||||
}
|
||||
|
||||
private lateinit var groupDatabase: GroupDatabase
|
||||
private lateinit var recipientDatabase: RecipientDatabase
|
||||
private lateinit var groupTable: GroupTable
|
||||
private lateinit var recipientTable: RecipientTable
|
||||
private lateinit var groupsV2API: GroupsV2Api
|
||||
private lateinit var groupsV2Authorization: GroupsV2Authorization
|
||||
private lateinit var profileAndMessageHelper: GroupsV2StateProcessor.ProfileAndMessageHelper
|
||||
@@ -88,13 +88,13 @@ class GroupsV2StateProcessorTest {
|
||||
Log.initialize(SystemOutLogger())
|
||||
SignalProtocolLoggerProvider.setProvider(CustomSignalProtocolLogger())
|
||||
|
||||
groupDatabase = mock(GroupDatabase::class.java)
|
||||
recipientDatabase = mock(RecipientDatabase::class.java)
|
||||
groupTable = mock(GroupTable::class.java)
|
||||
recipientTable = mock(RecipientTable::class.java)
|
||||
groupsV2API = mock(GroupsV2Api::class.java)
|
||||
groupsV2Authorization = mock(GroupsV2Authorization::class.java)
|
||||
profileAndMessageHelper = mock(GroupsV2StateProcessor.ProfileAndMessageHelper::class.java)
|
||||
|
||||
processor = GroupsV2StateProcessor.StateProcessorForGroup(serviceIds, ApplicationProvider.getApplicationContext(), groupDatabase, groupsV2API, groupsV2Authorization, masterKey, profileAndMessageHelper)
|
||||
processor = GroupsV2StateProcessor.StateProcessorForGroup(serviceIds, ApplicationProvider.getApplicationContext(), groupTable, groupsV2API, groupsV2Authorization, masterKey, profileAndMessageHelper)
|
||||
}
|
||||
|
||||
@After
|
||||
@@ -105,8 +105,8 @@ class GroupsV2StateProcessorTest {
|
||||
private fun given(init: GroupStateTestData.() -> Unit) {
|
||||
val data = givenData(init)
|
||||
|
||||
doReturn(data.groupRecord).`when`(groupDatabase).getGroup(any(GroupId.V2::class.java))
|
||||
doReturn(!data.groupRecord.isPresent).`when`(groupDatabase).isUnknownGroup(any())
|
||||
doReturn(data.groupRecord).`when`(groupTable).getGroup(any(GroupId.V2::class.java))
|
||||
doReturn(!data.groupRecord.isPresent).`when`(groupTable).isUnknownGroup(any())
|
||||
|
||||
data.serverState?.let { serverState ->
|
||||
val testPartial = object : PartialDecryptedGroup(null, serverState, null, null) {
|
||||
@@ -306,7 +306,7 @@ class GroupsV2StateProcessorTest {
|
||||
apiCallParameters(2, true)
|
||||
}
|
||||
|
||||
doReturn(true).`when`(groupDatabase).isUnknownGroup(any())
|
||||
doReturn(true).`when`(groupTable).isUnknownGroup(any())
|
||||
|
||||
val result = processor.updateLocalGroupToRevision(2, 0, DecryptedGroupChange.getDefaultInstance())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user