Search in sources :

Example 11 with Group

use of org.signal.storageservice.protos.groups.Group in project Signal-Android by WhisperSystems.

the class GroupsV2Operations_decrypt_group_Test method decrypt_message_timer_field_4.

@Test
public void decrypt_message_timer_field_4() throws VerificationFailedException, InvalidGroupStateException {
    Group group = Group.newBuilder().setDisappearingMessagesTimer(groupOperations.encryptTimer(123)).build();
    DecryptedGroup decryptedGroup = groupOperations.decryptGroup(group);
    assertEquals(123, decryptedGroup.getDisappearingMessagesTimer().getDuration());
}
Also used : Group(org.signal.storageservice.protos.groups.Group) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) Test(org.junit.Test)

Example 12 with Group

use of org.signal.storageservice.protos.groups.Group in project Signal-Android by WhisperSystems.

the class GroupsV2Operations_decrypt_group_Test method decrypt_title_field_2.

@Test
public void decrypt_title_field_2() throws VerificationFailedException, InvalidGroupStateException {
    Group group = Group.newBuilder().setTitle(groupOperations.encryptTitle("Title!")).build();
    DecryptedGroup decryptedGroup = groupOperations.decryptGroup(group);
    assertEquals("Title!", decryptedGroup.getTitle());
}
Also used : Group(org.signal.storageservice.protos.groups.Group) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) Test(org.junit.Test)

Example 13 with Group

use of org.signal.storageservice.protos.groups.Group in project Signal-Android by WhisperSystems.

the class GroupsV2Operations_decrypt_group_Test method set_revision_field_6.

@Test
public void set_revision_field_6() throws VerificationFailedException, InvalidGroupStateException {
    Group group = Group.newBuilder().setRevision(99).build();
    DecryptedGroup decryptedGroup = groupOperations.decryptGroup(group);
    assertEquals(99, decryptedGroup.getRevision());
}
Also used : Group(org.signal.storageservice.protos.groups.Group) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) Test(org.junit.Test)

Aggregations

Group (org.signal.storageservice.protos.groups.Group)13 DecryptedGroup (org.signal.storageservice.protos.groups.local.DecryptedGroup)13 Test (org.junit.Test)11 UUID (java.util.UUID)3 ByteString (com.google.protobuf.ByteString)2 ProfileKey (org.signal.zkgroup.profiles.ProfileKey)2 AccessControl (org.signal.storageservice.protos.groups.AccessControl)1 ProfileKeyCredential (org.signal.zkgroup.profiles.ProfileKeyCredential)1