use of org.whispersystems.signalservice.api.push.ACI in project Signal-Android by WhisperSystems.
the class RecipientIdCacheTest method if_cache_state_disagrees_returns_null.
@Test
public void if_cache_state_disagrees_returns_null() {
RecipientId recipientId1 = recipientId();
RecipientId recipientId2 = recipientId();
ACI aci = ACI.from(UUID.randomUUID());
String e164 = "+1555123456";
recipientIdCache.put(recipient(recipientId1, null, e164));
recipientIdCache.put(recipient(recipientId2, aci, null));
RecipientId recipientId = recipientIdCache.get(aci, e164);
assertNull(recipientId);
assertEquals(1, logRecorder.getWarnings().size());
assertEquals("Seen invalid RecipientIdCacheState", logRecorder.getWarnings().get(0).getMessage());
}
use of org.whispersystems.signalservice.api.push.ACI in project Signal-Android by WhisperSystems.
the class RecipientIdCacheTest method cache_miss_by_e164_uuid_not_supplied_on_put.
@Test
public void cache_miss_by_e164_uuid_not_supplied_on_put() {
RecipientId recipientId1 = recipientId();
ACI aci1 = ACI.from(UUID.randomUUID());
String e164 = "+1555123456";
recipientIdCache.put(recipient(recipientId1, null, e164));
RecipientId recipientId = recipientIdCache.get(aci1, e164);
assertNull(recipientId);
}
use of org.whispersystems.signalservice.api.push.ACI in project Signal-Android by WhisperSystems.
the class RecipientIdCacheTest method cache_miss_by_uuid_e164_not_supplied_on_put.
@Test
public void cache_miss_by_uuid_e164_not_supplied_on_put() {
RecipientId recipientId1 = recipientId();
ACI aci1 = ACI.from(UUID.randomUUID());
recipientIdCache.put(recipient(recipientId1, aci1, null));
RecipientId recipientId = recipientIdCache.get(aci1, "+15551234567");
assertNull(recipientId);
}
use of org.whispersystems.signalservice.api.push.ACI in project Signal-Android by WhisperSystems.
the class RecipientIdCacheTest method cache_hit_by_uuid_e164_not_supplied_on_get.
@Test
public void cache_hit_by_uuid_e164_not_supplied_on_get() {
RecipientId recipientId1 = recipientId();
ACI aci1 = ACI.from(UUID.randomUUID());
recipientIdCache.put(recipient(recipientId1, aci1, "+15551234567"));
RecipientId recipientId = recipientIdCache.get(aci1, null);
assertEquals(recipientId1, recipientId);
}
use of org.whispersystems.signalservice.api.push.ACI in project Signal-Android by WhisperSystems.
the class RecipientIdCacheTest method cache_miss_by_uuid.
@Test
public void cache_miss_by_uuid() {
RecipientId recipientId1 = recipientId();
ACI aci1 = ACI.from(UUID.randomUUID());
ACI aci2 = ACI.from(UUID.randomUUID());
recipientIdCache.put(recipient(recipientId1, aci1, null));
RecipientId recipientId = recipientIdCache.get(aci2, null);
assertNull(recipientId);
}
Aggregations