use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_group_Test method avatar_field_passed_through_3.
@Test
public void avatar_field_passed_through_3() throws VerificationFailedException, InvalidGroupStateException {
Group group = Group.newBuilder().setAvatar("AvatarCdnKey").build();
DecryptedGroup decryptedGroup = groupOperations.decryptGroup(group);
assertEquals("AvatarCdnKey", decryptedGroup.getAvatar());
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroup 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());
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupChangeUtil_resolveConflict_decryptedOnly_Test method field_13__no_attribute_access_change_is_removed.
@Test
public void field_13__no_attribute_access_change_is_removed() {
DecryptedGroup groupState = DecryptedGroup.newBuilder().setAccessControl(AccessControl.newBuilder().setAttributes(AccessControl.AccessRequired.ADMINISTRATOR)).build();
DecryptedGroupChange decryptedChange = DecryptedGroupChange.newBuilder().setNewAttributeAccess(AccessControl.AccessRequired.ADMINISTRATOR).build();
DecryptedGroupChange resolvedChanges = GroupChangeUtil.resolveConflict(groupState, decryptedChange).build();
assertTrue(DecryptedGroupUtil.changeIsEmpty(resolvedChanges));
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupChangeUtil_resolveConflict_decryptedOnly_Test method field_10__no_title_change_is_removed.
@Test
public void field_10__no_title_change_is_removed() {
DecryptedGroup groupState = DecryptedGroup.newBuilder().setTitle("Existing title").build();
DecryptedGroupChange decryptedChange = DecryptedGroupChange.newBuilder().setNewTitle(DecryptedString.newBuilder().setValue("Existing title").build()).build();
DecryptedGroupChange resolvedChanges = GroupChangeUtil.resolveConflict(groupState, decryptedChange).build();
assertTrue(DecryptedGroupUtil.changeIsEmpty(resolvedChanges));
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupChangeUtil_resolveConflict_decryptedOnly_Test method field_21__announcement_change_is_preserved.
@Test
public void field_21__announcement_change_is_preserved() {
DecryptedGroup groupState = DecryptedGroup.newBuilder().setIsAnnouncementGroup(EnabledState.DISABLED).build();
DecryptedGroupChange decryptedChange = DecryptedGroupChange.newBuilder().setNewIsAnnouncementGroup(EnabledState.ENABLED).build();
DecryptedGroupChange resolvedChanges = GroupChangeUtil.resolveConflict(groupState, decryptedChange).build();
assertEquals(decryptedChange, resolvedChanges);
}
Aggregations