diff --git a/briar-core/src/test/java/org/briarproject/briar/introduction/IntroductionIntegrationTest.java b/briar-core/src/test/java/org/briarproject/briar/introduction/IntroductionIntegrationTest.java index 9c410e238627d6b69183a4b92aba6fece19c8373..816957dd4ae254f69983f08f28485fa3d80a00cf 100644 --- a/briar-core/src/test/java/org/briarproject/briar/introduction/IntroductionIntegrationTest.java +++ b/briar-core/src/test/java/org/briarproject/briar/introduction/IntroductionIntegrationTest.java @@ -558,6 +558,58 @@ public class IntroductionIntegrationTest assertFalse(listener2.aborted); } + @Test + public void testIntroductionToRemovedContact() throws Exception { + // let contact1 and contact2 add each other + addContacts1And2(); + assertNotNull(contactId2From1); + assertNotNull(contactId1From2); + + // only introducee1 removes introducee2 + contactManager1.removeContact(contactId2From1); + + // both will accept the introduction + addListeners(true, true); + + // make the introduction + long time = clock.currentTimeMillis(); + introductionManager0 + .makeIntroduction(contact1From0, contact2From0, null, time); + + // sync REQUEST messages + sync0To1(1, true); + sync0To2(1, true); + + // sync ACCEPT messages back to introducer + sync1To0(1, true); + sync2To0(1, true); + + // sync forwarded ACCEPT messages to introducees + sync0To1(1, true); + sync0To2(1, true); + + // sync first AUTH and its forward + sync1To0(1, true); + sync0To2(1, true); + + // sync second AUTH and its forward as well as the following ACTIVATE + sync2To0(2, true); + sync0To1(2, true); + + // sync second ACTIVATE and its forward + sync1To0(1, true); + sync0To2(1, true); + + // Introduction only succeeded for introducee1 + assertTrue(listener1.succeeded); + assertFalse(listener2.succeeded); + + // assert that no session was aborted + assertFalse(listener0.aborted); + assertFalse(listener1.aborted); + assertFalse(listener2.aborted); + } + @Test public void testIntroducerRemovedCleanup() throws Exception { addListeners(true, true);