7
import com.alibaba.fastjson.JSON
import org.junit.Assert
import org.junit.Test
class A {
var id: Long = 0
var name: String = ""
}
class Test {
@Test
fun test() {
val s = "{\"id\":1,\"name\":\"a\"}"
val o = JSON.parseObject(s, A::class.java)
Assert.assertEquals(1, o.id) // 失败
Assert.assertEquals("a", o.name) // 失败
}
}
1.2.36版本正常,kotlin 1.1.4