File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ import org.junit.After
29
29
import org.junit.Before
30
30
import org.junit.Test
31
31
import org.junit.runner.RunWith
32
- import org.json.JSONObject
33
32
import org.robolectric.annotation.Config
34
33
import java.io.File
35
34
import java.io.IOException
@@ -232,7 +231,7 @@ class ServiceTest {
232
231
233
232
private fun parse (json : String ): String? {
234
233
return try {
235
- JSONObject ( json).getString( " result" )
234
+ json.fromJson< Map < String , Any >>()[ " result" ] as ? String
236
235
} catch (exception: Exception ) {
237
236
null
238
237
}
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ import kotlinx.coroutines.runBlocking
19
19
import okhttp3.Response
20
20
import org.junit.Before
21
21
import org.junit.Test
22
- import org.json.JSONObject
23
22
import java.io.File
24
23
import java.io.IOException
25
24
import java.nio.file.Files
@@ -199,7 +198,7 @@ class ServiceTest {
199
198
200
199
private fun parse (json : String ): String? {
201
200
return try {
202
- JSONObject ( json).getString( " result" )
201
+ json.fromJson< Map < String , Any >>()[ " result" ] as ? String
203
202
} catch (exception: Exception ) {
204
203
null
205
204
}
You can’t perform that action at this time.
0 commit comments