Search in sources :

Example 76 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method unknown_reset_group_link.

@Test
public void unknown_reset_group_link() {
    DecryptedGroupChange change = changeByUnknown().resetGroupLink().build();
    assertThat(describeChange(change), is(singletonList("The group link has been reset.")));
}
Also used : DecryptedGroupChange(org.signal.storageservice.protos.groups.local.DecryptedGroupChange) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 77 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method you_changed_group_link_access_to_administrator_approval.

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

Example 78 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method you_removed_you.

@Test
public void you_removed_you() {
    DecryptedGroupChange change = changeBy(you).deleteMember(you).build();
    assertThat(describeChange(change), is(singletonList("You left the group.")));
}
Also used : DecryptedGroupChange(org.signal.storageservice.protos.groups.local.DecryptedGroupChange) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 79 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method you_requested_to_join_the_group.

// Group link request
@Test
public void you_requested_to_join_the_group() {
    DecryptedGroupChange change = changeBy(you).requestJoin().build();
    assertThat(describeChange(change), is(singletonList("You sent a request to join the group.")));
}
Also used : DecryptedGroupChange(org.signal.storageservice.protos.groups.local.DecryptedGroupChange) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 80 with DecryptedGroupChange

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

the class GroupsV2UpdateMessageProducerTest method you_reset_group_link.

// Group link reset
@Test
public void you_reset_group_link() {
    DecryptedGroupChange change = changeBy(you).resetGroupLink().build();
    assertThat(describeChange(change), is(singletonList("You reset the group link.")));
}
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