mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +01:00
Add handshake key pairs to DB, remove inactive contacts.
This commit is contained in:
@@ -16,7 +16,7 @@ internal class ContactControllerImpl
|
||||
constructor(private val contactManager: ContactManager) : ContactController {
|
||||
|
||||
override fun list(ctx: Context): Context {
|
||||
val contacts = contactManager.activeContacts.map { contact ->
|
||||
val contacts = contactManager.contacts.map { contact ->
|
||||
contact.output()
|
||||
}
|
||||
return ctx.json(contacts)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user