Skip to content

Commit 40875b6

Browse files
committed
fix up the unit tests
1 parent 4854818 commit 40875b6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

library/src/main/java/org/xmtp/android/library/Client.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ class Client() {
506506
return apiClient.subscribe(request = request)
507507
}
508508

509-
fun fetchConversation(topic: String?, includeGroups: Boolean = false): Conversation? {
509+
suspend fun fetchConversation(topic: String?, includeGroups: Boolean = false): Conversation? {
510510
if (topic.isNullOrBlank()) return null
511511
return conversations.list(includeGroups = includeGroups).firstOrNull {
512512
it.topic == topic

library/src/main/java/org/xmtp/android/library/Conversation.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ sealed class Conversation {
229229
* If [limit] is specified then results are pulled in pages of that size.
230230
* If [direction] is specified then that will control the sort order of te messages.
231231
*/
232-
fun messages(
232+
suspend fun messages(
233233
limit: Int? = null,
234234
before: Date? = null,
235235
after: Date? = null,
@@ -262,7 +262,7 @@ sealed class Conversation {
262262
}
263263
}
264264

265-
fun decryptedMessages(
265+
suspend fun decryptedMessages(
266266
limit: Int? = null,
267267
before: Date? = null,
268268
after: Date? = null,

library/src/test/java/org/xmtp/android/library/RemoteAttachmentTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class RemoteAttachmentTest {
7979
)
8080
}
8181

82-
val messages = aliceConversation.messages()
82+
val messages = runBlocking { aliceConversation.messages() }
8383
Assert.assertEquals(messages.size, 1)
8484

8585
if (messages.size == 1) {
@@ -161,7 +161,7 @@ class RemoteAttachmentTest {
161161
)
162162
}
163163

164-
val messages = aliceConversation.messages()
164+
val messages = runBlocking { aliceConversation.messages() }
165165
Assert.assertEquals(messages.size, 1)
166166

167167
// Tamper with the payload

0 commit comments

Comments
 (0)