mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Remove pending contact state from the database.
This commit is contained in:
@@ -19,7 +19,6 @@ import static org.briarproject.bramble.api.contact.HandshakeLinkConstants.BASE32
|
||||
import static org.briarproject.bramble.api.contact.HandshakeLinkConstants.FORMAT_VERSION;
|
||||
import static org.briarproject.bramble.api.contact.HandshakeLinkConstants.ID_LABEL;
|
||||
import static org.briarproject.bramble.api.contact.HandshakeLinkConstants.RAW_LINK_BYTES;
|
||||
import static org.briarproject.bramble.api.contact.PendingContactState.WAITING_FOR_CONNECTION;
|
||||
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
|
||||
import static org.briarproject.bramble.test.TestUtils.getAgreementPublicKey;
|
||||
import static org.briarproject.bramble.test.TestUtils.getRandomId;
|
||||
@@ -108,7 +107,6 @@ public class PendingContactFactoryImplTest extends BrambleMockTestCase {
|
||||
assertArrayEquals(publicKey.getEncoded(),
|
||||
p.getPublicKey().getEncoded());
|
||||
assertEquals(alias, p.getAlias());
|
||||
assertEquals(WAITING_FOR_CONNECTION, p.getState());
|
||||
assertEquals(timestamp, p.getTimestamp());
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ import static java.util.Collections.emptyMap;
|
||||
import static java.util.Collections.singletonList;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.briarproject.bramble.api.contact.PendingContactState.FAILED;
|
||||
import static org.briarproject.bramble.api.db.Metadata.REMOVE;
|
||||
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
|
||||
import static org.briarproject.bramble.api.sync.Group.Visibility.INVISIBLE;
|
||||
@@ -2211,16 +2210,6 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
||||
PendingContact retrieved = pendingContacts.iterator().next();
|
||||
assertEquals(pendingContact.getId(), retrieved.getId());
|
||||
assertEquals(pendingContact.getAlias(), retrieved.getAlias());
|
||||
assertEquals(pendingContact.getState(), retrieved.getState());
|
||||
assertEquals(pendingContact.getTimestamp(), retrieved.getTimestamp());
|
||||
|
||||
db.setPendingContactState(txn, pendingContact.getId(), FAILED);
|
||||
pendingContacts = db.getPendingContacts(txn);
|
||||
assertEquals(1, pendingContacts.size());
|
||||
retrieved = pendingContacts.iterator().next();
|
||||
assertEquals(pendingContact.getId(), retrieved.getId());
|
||||
assertEquals(pendingContact.getAlias(), retrieved.getAlias());
|
||||
assertEquals(FAILED, retrieved.getState());
|
||||
assertEquals(pendingContact.getTimestamp(), retrieved.getTimestamp());
|
||||
|
||||
db.removePendingContact(txn, pendingContact.getId());
|
||||
@@ -2232,8 +2221,8 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
||||
|
||||
@Test
|
||||
public void testSetHandshakeKeyPair() throws Exception {
|
||||
Identity withoutKeys =
|
||||
new Identity(localAuthor, null, null, identity.getTimeCreated());
|
||||
Identity withoutKeys = new Identity(localAuthor, null, null,
|
||||
identity.getTimeCreated());
|
||||
assertFalse(withoutKeys.hasHandshakeKeyPair());
|
||||
PublicKey publicKey = getAgreementPublicKey();
|
||||
PrivateKey privateKey = getAgreementPrivateKey();
|
||||
|
||||
Reference in New Issue
Block a user