Add handshake key pairs to DB, remove inactive contacts.

This commit is contained in:
akwizgran
2019-04-18 13:15:25 +01:00
parent dcebd5a81c
commit 0587fdc54c
44 changed files with 407 additions and 532 deletions

View File

@@ -5,7 +5,6 @@ import io.javalin.Context
import io.javalin.core.util.ContextUtil
import io.mockk.mockk
import org.briarproject.bramble.api.contact.Contact
import org.briarproject.bramble.api.contact.ContactId
import org.briarproject.bramble.api.contact.ContactManager
import org.briarproject.bramble.api.identity.Author
import org.briarproject.bramble.api.identity.IdentityManager
@@ -36,8 +35,7 @@ abstract class ControllerTest {
protected val group: Group = getGroup(getClientId(), 0)
protected val author: Author = getAuthor()
protected val localAuthor: LocalAuthor = getLocalAuthor()
protected val contact =
Contact(ContactId(1), author, localAuthor.id, getRandomString(5), true, true)
protected val contact: Contact = getContact(author, localAuthor.id, true)
protected val message: Message = getMessage(group.id)
protected val text: String = getRandomString(5)
protected val timestamp = 42L

View File

@@ -19,14 +19,14 @@ internal class ContactControllerTest : ControllerTest() {
@Test
fun testEmptyContactList() {
every { contactManager.activeContacts } returns emptyList<Contact>()
every { contactManager.contacts } returns emptyList<Contact>()
every { ctx.json(emptyList<Any>()) } returns ctx
controller.list(ctx)
}
@Test
fun testList() {
every { contactManager.activeContacts } returns listOf(contact)
every { contactManager.contacts } returns listOf(contact)
every { ctx.json(listOf(contact.output())) } returns ctx
controller.list(ctx)
}