mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 04:33:36 +00:00
Inline the pnp feature flag.
This commit is contained in:
committed by
Cody Henthorne
parent
8ad77ac7aa
commit
c359ddf3c8
@@ -283,8 +283,6 @@ class ContactRecordProcessorTest {
|
||||
// GIVEN
|
||||
val subject = ContactRecordProcessor(ACI_A, PNI_A, E164_A, recipientTable)
|
||||
|
||||
featureFlags.`when`<Boolean> { FeatureFlags.phoneNumberPrivacy() }.thenReturn(true)
|
||||
|
||||
val local = buildRecord(
|
||||
STORAGE_ID_A,
|
||||
record = ContactRecord(
|
||||
@@ -317,8 +315,6 @@ class ContactRecordProcessorTest {
|
||||
// GIVEN
|
||||
val subject = ContactRecordProcessor(ACI_A, PNI_A, E164_A, recipientTable)
|
||||
|
||||
featureFlags.`when`<Boolean> { FeatureFlags.phoneNumberPrivacy() }.thenReturn(true)
|
||||
|
||||
val local = buildRecord(
|
||||
STORAGE_ID_A,
|
||||
record = ContactRecord(
|
||||
@@ -351,8 +347,6 @@ class ContactRecordProcessorTest {
|
||||
// GIVEN
|
||||
val subject = ContactRecordProcessor(ACI_A, PNI_A, E164_A, recipientTable)
|
||||
|
||||
featureFlags.`when`<Boolean> { FeatureFlags.phoneNumberPrivacy() }.thenReturn(true)
|
||||
|
||||
val local = buildRecord(
|
||||
STORAGE_ID_A,
|
||||
record = ContactRecord(
|
||||
@@ -380,40 +374,6 @@ class ContactRecordProcessorTest {
|
||||
assertEquals(remote.pni.get(), result.pni.get())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `merge, pnpDisabled, pniNotDropped`() {
|
||||
// GIVEN
|
||||
val subject = ContactRecordProcessor(ACI_A, PNI_A, E164_A, recipientTable)
|
||||
|
||||
featureFlags.`when`<Boolean> { FeatureFlags.phoneNumberPrivacy() }.thenReturn(false)
|
||||
|
||||
val local = buildRecord(
|
||||
STORAGE_ID_A,
|
||||
record = ContactRecord(
|
||||
aci = ACI_A.toString(),
|
||||
e164 = E164_A,
|
||||
pni = PNI_A.toStringWithoutPrefix()
|
||||
)
|
||||
)
|
||||
|
||||
val remote = buildRecord(
|
||||
STORAGE_ID_B,
|
||||
record = ContactRecord(
|
||||
aci = ACI_A.toString(),
|
||||
e164 = E164_B,
|
||||
pni = PNI_B.toStringWithoutPrefix()
|
||||
)
|
||||
)
|
||||
|
||||
// WHEN
|
||||
val result = subject.merge(remote, local, TestKeyGenerator(STORAGE_ID_C))
|
||||
|
||||
// THEN
|
||||
assertEquals(remote.aci, result.aci)
|
||||
assertEquals(remote.number.get(), result.number.get())
|
||||
assertEquals(true, result.pni.isPresent)
|
||||
}
|
||||
|
||||
private fun buildRecord(id: StorageId = STORAGE_ID_A, record: ContactRecord): SignalContactRecord {
|
||||
return SignalContactRecord(id, record)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user