mirror of
https://github.com/etesync/android
synced 2025-06-23 16:38:51 +00:00
Tests: update according to changes with owners adding themselves as members.
This commit is contained in:
parent
4795bd40ef
commit
c6c5ff1c80
@ -235,7 +235,6 @@ class ServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
@Throws(IOException::class, Exceptions.HttpException::class, Exceptions.GenericCryptoException::class, Exceptions.IntegrityException::class)
|
@Throws(IOException::class, Exceptions.HttpException::class, Exceptions.GenericCryptoException::class, Exceptions.IntegrityException::class)
|
||||||
fun testJournalMember() {
|
fun testJournalMember() {
|
||||||
var caught: Exception?
|
|
||||||
val journalManager = JournalManager(httpClient!!, remote!!)
|
val journalManager = JournalManager(httpClient!!, remote!!)
|
||||||
val info = CollectionInfo.defaultForServiceType(CollectionInfo.Type.ADDRESS_BOOK)
|
val info = CollectionInfo.defaultForServiceType(CollectionInfo.Type.ADDRESS_BOOK)
|
||||||
info.uid = JournalManager.Journal.genUid()
|
info.uid = JournalManager.Journal.genUid()
|
||||||
@ -248,14 +247,11 @@ class ServiceTest {
|
|||||||
|
|
||||||
// Test inviting ourselves
|
// Test inviting ourselves
|
||||||
val member = JournalManager.Member(Helpers.USER, "test".toByteArray())
|
val member = JournalManager.Member(Helpers.USER, "test".toByteArray())
|
||||||
try {
|
journalManager.addMember(journal, member)
|
||||||
caught = null
|
// We shouldn't show in the list
|
||||||
journalManager.addMember(journal, member)
|
assertEquals(journalManager.listMembers(journal).size.toLong(), 0)
|
||||||
} catch (e: Exceptions.HttpException) {
|
// Though we should have a key in the journal
|
||||||
caught = e
|
assertNotNull(journalManager.list().first().key)
|
||||||
}
|
|
||||||
|
|
||||||
assertNotNull(caught)
|
|
||||||
|
|
||||||
val member2 = JournalManager.Member(Helpers.USER2, "test".toByteArray())
|
val member2 = JournalManager.Member(Helpers.USER2, "test".toByteArray())
|
||||||
journalManager.addMember(journal, member2)
|
journalManager.addMember(journal, member2)
|
||||||
|
Loading…
Reference in New Issue
Block a user