Skip to content

Commit cc1da05

Browse files
committed
fix: android and kotlin tests.
1 parent 1b97935 commit cc1da05

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

tests/languages/android/Tests.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import org.junit.After
2929
import org.junit.Before
3030
import org.junit.Test
3131
import org.junit.runner.RunWith
32-
import org.json.JSONObject
3332
import org.robolectric.annotation.Config
3433
import java.io.File
3534
import java.io.IOException
@@ -232,7 +231,7 @@ class ServiceTest {
232231

233232
private fun parse(json: String): String? {
234233
return try {
235-
JSONObject(json).getString("result")
234+
json.fromJson<Map<String, Any>>()["result"] as? String
236235
} catch (exception: Exception) {
237236
null
238237
}

tests/languages/kotlin/Tests.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import kotlinx.coroutines.runBlocking
1919
import okhttp3.Response
2020
import org.junit.Before
2121
import org.junit.Test
22-
import org.json.JSONObject
2322
import java.io.File
2423
import java.io.IOException
2524
import java.nio.file.Files
@@ -199,7 +198,7 @@ class ServiceTest {
199198

200199
private fun parse(json: String): String? {
201200
return try {
202-
JSONObject(json).getString("result")
201+
json.fromJson<Map<String, Any>>()["result"] as? String
203202
} catch (exception: Exception) {
204203
null
205204
}

0 commit comments

Comments
 (0)