use of org.signal.storageservice.protos.groups.GroupChange in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_change_Test method cannot_decrypt_change_with_epoch_higher_than_known.
@Test
public void cannot_decrypt_change_with_epoch_higher_than_known() throws InvalidProtocolBufferException, VerificationFailedException, InvalidGroupStateException {
GroupChange change = GroupChange.newBuilder().setChangeEpoch(GroupsV2Operations.HIGHEST_KNOWN_EPOCH + 1).build();
Optional<DecryptedGroupChange> decryptedGroupChangeOptional = groupOperations.decryptChange(change, false);
assertFalse(decryptedGroupChangeOptional.isPresent());
}
use of org.signal.storageservice.protos.groups.GroupChange in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_change_Test method assertDecryption.
void assertDecryption(GroupChange.Actions.Builder inputChange, DecryptedGroupChange.Builder expectedDecrypted) {
UUID editor = UUID.randomUUID();
GroupChange.Actions actions = inputChange.setSourceUuid(groupOperations.encryptUuid(editor)).build();
GroupChange change = GroupChange.newBuilder().setActions(actions.toByteString()).build();
DecryptedGroupChange decryptedGroupChange = decrypt(change);
assertEquals(expectedDecrypted.setEditor(UuidUtil.toByteString(editor)).build(), decryptedGroupChange);
}
Aggregations