mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Fixed a failing test.
This commit is contained in:
@@ -31,6 +31,7 @@ public class GroupInvitationIntegrationTest extends BriarIntegrationTest {
|
|||||||
groupInvitationManager1;
|
groupInvitationManager1;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
@@ -252,18 +253,33 @@ public class GroupInvitationIntegrationTest extends BriarIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreatorLeavesBeforeInvitationAnswered() throws Exception {
|
public void testCreatorLeavesBeforeInvitationAnswered() throws Exception {
|
||||||
|
// Creator invites invitee to join group
|
||||||
sendInvitation(clock.currentTimeMillis(), null);
|
sendInvitation(clock.currentTimeMillis(), null);
|
||||||
|
|
||||||
|
// Creator's invite message is delivered to invitee
|
||||||
sync0To1(1, true);
|
sync0To1(1, true);
|
||||||
|
|
||||||
|
// Creator leaves group
|
||||||
|
assertEquals(1, groupManager0.getPrivateGroups().size());
|
||||||
groupManager0.removePrivateGroup(privateGroup0.getId());
|
groupManager0.removePrivateGroup(privateGroup0.getId());
|
||||||
assertEquals(0, groupManager0.getPrivateGroups().size());
|
assertEquals(0, groupManager0.getPrivateGroups().size());
|
||||||
// sync0To1(1, true);
|
|
||||||
// FIXME
|
// Invitee responds to invitation
|
||||||
|
assertEquals(0, groupManager1.getPrivateGroups().size());
|
||||||
groupInvitationManager1
|
groupInvitationManager1
|
||||||
.respondToInvitation(contactId0From1, privateGroup0, true);
|
.respondToInvitation(contactId0From1, privateGroup0, true);
|
||||||
|
assertEquals(1, groupManager1.getPrivateGroups().size());
|
||||||
|
assertFalse(groupManager1.isDissolved(privateGroup0.getId()));
|
||||||
|
|
||||||
|
// Invitee's join message is delivered to creator
|
||||||
sync1To0(1, true);
|
sync1To0(1, true);
|
||||||
|
|
||||||
assertEquals(0, groupManager1.getPrivateGroups().size());
|
// Creator's leave message is delivered to invitee
|
||||||
|
sync0To1(1, true);
|
||||||
|
|
||||||
|
// Group is marked as dissolved
|
||||||
|
assertTrue(groupManager1.isDissolved(privateGroup0.getId()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendInvitation(long timestamp, @Nullable String msg) throws
|
private void sendInvitation(long timestamp, @Nullable String msg) throws
|
||||||
|
|||||||
Reference in New Issue
Block a user