File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
live-objects/src/test/kotlin/io/ably/lib/objects Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ okhttp = "4.12.0"
21
21
test-retry = " 1.6.0"
22
22
kotlin = " 2.1.10"
23
23
coroutine = " 1.9.0"
24
- mockk = " 1.13.13 "
24
+ mockk = " 1.14.2 "
25
25
turbine = " 1.2.0"
26
- ktor = " 3.0.1 "
26
+ ktor = " 3.1.0 "
27
27
jetbrains-annoations = " 26.0.2"
28
28
29
29
[libraries ]
Original file line number Diff line number Diff line change @@ -45,14 +45,14 @@ private fun Class<*>.findField(name: String): Field {
45
45
return result.getOrNull() as Field
46
46
}
47
47
48
- suspend fun <T >Any.invokePrivateSuspendMethod (methodName : String , vararg args : Any? ) = suspendCancellableCoroutine<T > { cont ->
49
- val suspendMethod = javaClass.declaredMethods.find { it.name == methodName }
50
- suspendMethod?.let {
51
- it.isAccessible = true
52
- it.invoke(this , * args, cont)
53
- }
48
+ suspend fun <T > Any.invokePrivateSuspendMethod (methodName : String , vararg args : Any? ): T = suspendCancellableCoroutine { cont ->
49
+ val suspendMethod = javaClass.declaredMethods.find { it.name == methodName }
50
+ ? : error(" Method '$methodName ' not found" )
51
+ suspendMethod.isAccessible = true
52
+ suspendMethod.invoke(this , * args, cont)
54
53
}
55
54
55
+
56
56
fun <T > Any.invokePrivateMethod (methodName : String , vararg args : Any? ): T {
57
57
val method = javaClass.declaredMethods.find { it.name == methodName }
58
58
method?.isAccessible = true
Original file line number Diff line number Diff line change 1
1
package io.ably.lib.objects.unit.setup
2
2
3
- import io.ably.lib.objects.integration.setup.ensureAttached
4
3
import io.ably.lib.realtime.AblyRealtime
5
4
import io.ably.lib.realtime.Channel
6
5
import io.ably.lib.realtime.ChannelState
You can’t perform that action at this time.
0 commit comments