Search in sources :

Example 1 with AccessControl

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

the class GroupsV2Operations_decrypt_group_Test method pass_through_access_control_field_5.

@Test
public void pass_through_access_control_field_5() throws VerificationFailedException, InvalidGroupStateException {
    AccessControl accessControl = AccessControl.newBuilder().setMembers(AccessControl.AccessRequired.ADMINISTRATOR).setAttributes(AccessControl.AccessRequired.MEMBER).setAddFromInviteLink(AccessControl.AccessRequired.UNSATISFIABLE).build();
    Group group = Group.newBuilder().setAccessControl(accessControl).build();
    DecryptedGroup decryptedGroup = groupOperations.decryptGroup(group);
    assertEquals(accessControl, decryptedGroup.getAccessControl());
}
Also used : Group(org.signal.storageservice.protos.groups.Group) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) AccessControl(org.signal.storageservice.protos.groups.AccessControl) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) Test(org.junit.Test)

Example 2 with AccessControl

use of org.signal.storageservice.protos.groups.AccessControl in project Signal-Android by signalapp.

the class GroupsV2Operations_decrypt_group_Test method pass_through_access_control_field_5.

@Test
public void pass_through_access_control_field_5() throws VerificationFailedException, InvalidGroupStateException {
    AccessControl accessControl = AccessControl.newBuilder().setMembers(AccessControl.AccessRequired.ADMINISTRATOR).setAttributes(AccessControl.AccessRequired.MEMBER).setAddFromInviteLink(AccessControl.AccessRequired.UNSATISFIABLE).build();
    Group group = Group.newBuilder().setAccessControl(accessControl).build();
    DecryptedGroup decryptedGroup = groupOperations.decryptGroup(group);
    assertEquals(accessControl, decryptedGroup.getAccessControl());
}
Also used : Group(org.signal.storageservice.protos.groups.Group) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) AccessControl(org.signal.storageservice.protos.groups.AccessControl) DecryptedGroup(org.signal.storageservice.protos.groups.local.DecryptedGroup) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 AccessControl (org.signal.storageservice.protos.groups.AccessControl)2 Group (org.signal.storageservice.protos.groups.Group)2 DecryptedGroup (org.signal.storageservice.protos.groups.local.DecryptedGroup)2