Search in sources :

Example 86 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method member_changed_group_link_access_to_any.

@Test
public void member_changed_group_link_access_to_any() {
    DecryptedGroupChange change = changeBy(alice).inviteLinkAccess(AccessControl.AccessRequired.ANY).build();
    assertThat(describeChange(change), is(singletonList("Alice turned on the group link with admin approval off.")));
}
Also used : DecryptedGroupChange(org.signal.storageservice.protos.groups.local.DecryptedGroupChange) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 87 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method multiple_changes_by_unknown.

@Test
public void multiple_changes_by_unknown() {
    DecryptedGroupChange change = changeByUnknown().addMember(bob).membershipAccess(AccessControl.AccessRequired.MEMBER).title("Title 2").avatar("Avatar 1").timer(600).build();
    assertThat(describeChange(change), is(Arrays.asList("Bob joined the group.", "The group name has changed to \"" + isolateBidi("Title 2") + "\".", "The group avatar has been changed.", "The disappearing message timer has been set to 10 minutes.", "Who can edit group membership has been changed to \"All members\".")));
}
Also used : DecryptedGroupChange(org.signal.storageservice.protos.groups.local.DecryptedGroupChange) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 88 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method unknown_member_added_you_and_another_where_you_are_not_first.

@Test
public void unknown_member_added_you_and_another_where_you_are_not_first() {
    DecryptedGroupChange change = changeByUnknown().addMember(alice).addMember(you).build();
    assertThat(describeChange(change), is(Arrays.asList("You joined the group.", "Alice joined the group.")));
}
Also used : DecryptedGroupChange(org.signal.storageservice.protos.groups.local.DecryptedGroupChange) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 89 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method member_denied_your_join_request.

@Test
public void member_denied_your_join_request() {
    DecryptedGroupChange change = changeBy(alice).denyRequest(you).build();
    assertThat(describeChange(change), is(singletonList("Your request to join the group has been denied by an admin.")));
}
Also used : DecryptedGroupChange(org.signal.storageservice.protos.groups.local.DecryptedGroupChange) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 90 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method member_added_member.

// Member additions
@Test
public void member_added_member() {
    DecryptedGroupChange change = changeBy(alice).addMember(bob).build();
    assertThat(describeChange(change), is(singletonList("Alice added Bob.")));
}
Also used : DecryptedGroupChange(org.signal.storageservice.protos.groups.local.DecryptedGroupChange) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

DecryptedGroupChange (org.signal.storageservice.protos.groups.local.DecryptedGroupChange)486 Test (org.junit.Test)460 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)234 DecryptedGroup (org.signal.storageservice.protos.groups.local.DecryptedGroup)190 UUID (java.util.UUID)110 GroupChange (org.signal.storageservice.protos.groups.GroupChange)62 ProfileKey (org.signal.zkgroup.profiles.ProfileKey)34 ProtoTestUtils.randomProfileKey (org.whispersystems.signalservice.api.groupsv2.ProtoTestUtils.randomProfileKey)34 ByteString (com.google.protobuf.ByteString)18 DecryptedMember (org.signal.storageservice.protos.groups.local.DecryptedMember)14 NonNull (androidx.annotation.NonNull)12 DecryptedPendingMember (org.signal.storageservice.protos.groups.local.DecryptedPendingMember)12 DecryptedGroupV2Context (org.thoughtcrime.securesms.database.model.databaseprotos.DecryptedGroupV2Context)12 ProtoTestUtils.newProfileKey (org.whispersystems.signalservice.api.groupsv2.ProtoTestUtils.newProfileKey)12 ProtoTestUtils.withProfileKey (org.whispersystems.signalservice.api.groupsv2.ProtoTestUtils.withProfileKey)12 DecryptedPendingMemberRemoval (org.signal.storageservice.protos.groups.local.DecryptedPendingMemberRemoval)10 DecryptedRequestingMember (org.signal.storageservice.protos.groups.local.DecryptedRequestingMember)10 Context (android.content.Context)8 DrawableRes (androidx.annotation.DrawableRes)8 Nullable (androidx.annotation.Nullable)8