Skip to content

Commit 9cac543

Browse files
committed
[ECO-5338] Fixed liveobject test dependency, utils as per review comments
1 parent e0b4dcd commit 9cac543

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ kotlin = "2.1.10"
2323
coroutine = "1.9.0"
2424
mockk = "1.14.2"
2525
turbine = "1.2.0"
26-
ktor = "3.1.0"
26+
ktor = "3.1.3"
2727
jetbrains-annoations = "26.0.2"
2828

2929
[libraries]

live-objects/src/main/kotlin/io/ably/lib/objects/Helpers.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.ably.lib.objects
22

33
import io.ably.lib.realtime.CompletionListener
4-
import io.ably.lib.types.AblyException
54
import io.ably.lib.types.ErrorInfo
65
import io.ably.lib.types.ProtocolMessage
76
import kotlinx.coroutines.suspendCancellableCoroutine
@@ -16,7 +15,7 @@ internal suspend fun LiveObjectsAdapter.sendAsync(message: ProtocolMessage) = su
1615
}
1716

1817
override fun onError(reason: ErrorInfo) {
19-
continuation.resumeWithException(AblyException.fromErrorInfo(reason))
18+
continuation.resumeWithException(ablyException(reason))
2019
}
2120
})
2221
} catch (e: Exception) {

live-objects/src/test/kotlin/io/ably/lib/objects/TestUtils.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ suspend fun <T> Any.invokePrivateSuspendMethod(methodName: String, vararg args:
5353
}
5454

5555
fun <T> Any.invokePrivateMethod(methodName: String, vararg args: Any?): T {
56-
val method = javaClass.declaredMethods.find { it.name == methodName }
57-
method?.isAccessible = true
56+
val method = javaClass.declaredMethods.find { it.name == methodName } ?: error("Method '$methodName' not found")
57+
method.isAccessible = true
5858
@Suppress("UNCHECKED_CAST")
59-
return method?.invoke(this, *args) as T
59+
return method.invoke(this, *args) as T
6060
}

0 commit comments

Comments
 (0)