mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Address review comments.
This commit is contained in:
@@ -10,7 +10,6 @@ import org.briarproject.bramble.api.contact.ContactManager;
|
||||
import org.briarproject.bramble.api.contact.PendingContact;
|
||||
import org.briarproject.bramble.api.contact.PendingContactId;
|
||||
import org.briarproject.bramble.api.contact.PendingContactState;
|
||||
import org.briarproject.bramble.api.contact.event.PendingContactAddedEvent;
|
||||
import org.briarproject.bramble.api.contact.event.PendingContactRemovedEvent;
|
||||
import org.briarproject.bramble.api.contact.event.PendingContactStateChangedEvent;
|
||||
import org.briarproject.bramble.api.db.DatabaseExecutor;
|
||||
@@ -67,8 +66,7 @@ public class PendingContactListViewModel extends AndroidViewModel
|
||||
|
||||
@Override
|
||||
public void eventOccurred(Event e) {
|
||||
if (e instanceof PendingContactAddedEvent ||
|
||||
e instanceof PendingContactStateChangedEvent ||
|
||||
if (e instanceof PendingContactStateChangedEvent ||
|
||||
e instanceof PendingContactRemovedEvent) {
|
||||
loadPendingContacts();
|
||||
}
|
||||
|
||||
@@ -130,16 +130,11 @@ internal class ContactControllerTest : ControllerTest() {
|
||||
every { contactManager.pendingContacts } returns listOf(
|
||||
Pair(pendingContact, WAITING_FOR_CONNECTION)
|
||||
)
|
||||
every {
|
||||
ctx.json(
|
||||
listOf(
|
||||
JsonDict(
|
||||
"pendingContact" to pendingContact.output(),
|
||||
"state" to WAITING_FOR_CONNECTION.output()
|
||||
)
|
||||
)
|
||||
)
|
||||
} returns ctx
|
||||
val dict = JsonDict(
|
||||
"pendingContact" to pendingContact.output(),
|
||||
"state" to WAITING_FOR_CONNECTION.output()
|
||||
)
|
||||
every { ctx.json(listOf(dict)) } returns ctx
|
||||
controller.listPendingContacts(ctx)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user