use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupsV2UpdateMessageProducerTest method describe_a_group_you_are_not_in.
@Test
public void describe_a_group_you_are_not_in() {
DecryptedGroup group = newGroupBy(alice, 1).build();
assertThat(describeNewGroup(group), is("Group updated."));
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupsV2UpdateMessageProducerTest method you_created_a_group_change_not_found.
// Group state without a change record
@Test
public void you_created_a_group_change_not_found() {
DecryptedGroup group = newGroupBy(you, 0).build();
assertThat(describeNewGroup(group), is("You joined the group."));
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupsV2UpdateMessageProducerTest method alice_created_a_group_above_zero.
@Test
public void alice_created_a_group_above_zero() {
DecryptedGroup group = newGroupBy(alice, 1).member(you).build();
assertThat(describeNewGroup(group), is("You joined the group."));
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupStateMapperTest method known_group_three_states_to_update_update_latest_handle_missing_change.
@Test
public void known_group_three_states_to_update_update_latest_handle_missing_change() {
DecryptedGroup currentState = state(0);
ServerGroupLogEntry log1 = serverLogEntry(1);
ServerGroupLogEntry log2 = serverLogEntryWholeStateOnly(2);
ServerGroupLogEntry log3 = serverLogEntry(3);
AdvanceGroupStateResult advanceGroupStateResult = GroupStateMapper.partiallyAdvanceGroupState(new GlobalGroupState(currentState, asList(log1, log2, log3)), LATEST);
assertThat(advanceGroupStateResult.getProcessedLogEntries(), is(asList(asLocal(log1), localLogEntryNoEditor(2), asLocal(log3))));
assertNewState(new GlobalGroupState(log3.getGroup(), emptyList()), advanceGroupStateResult.getNewGlobalGroupState());
assertEquals(log3.getGroup(), advanceGroupStateResult.getNewGlobalGroupState().getLocalState());
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroup in project Signal-Android by WhisperSystems.
the class GroupStateMapperTest method known_group_with_no_states_to_update.
@Test
public void known_group_with_no_states_to_update() {
DecryptedGroup currentState = state(0);
AdvanceGroupStateResult advanceGroupStateResult = GroupStateMapper.partiallyAdvanceGroupState(new GlobalGroupState(currentState, emptyList()), 10);
assertThat(advanceGroupStateResult.getProcessedLogEntries(), is(emptyList()));
assertTrue(advanceGroupStateResult.getNewGlobalGroupState().getServerHistory().isEmpty());
assertSame(currentState, advanceGroupStateResult.getNewGlobalGroupState().getLocalState());
}
Aggregations