src/test/kotlin/com/flightfeather/obd/ObdApplicationTests.kt
@@ -1,7 +1,12 @@
package com.flightfeather.obd
import com.flightfeather.obd.domain.mapper.ObdDataMapper
import com.flightfeather.obd.lightshare.bean.BaseJson
import com.flightfeather.obd.lightshare.bean.ObdDataVo
import com.google.gson.Gson
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
@@ -9,8 +14,25 @@
@SpringBootTest
class ObdApplicationTests {
    @Autowired
    lateinit var obdDataMapper: ObdDataMapper
    @Test
    fun contextLoads() {
    }
    @Test
    fun foo1(): Unit {
//        val map = GsonJsonParser().parseMap("{\"vin\":\"vin001\",\"protocol\":2}")
        val map = Gson().fromJson("{\"vin\":\"vin001\",\"protocol\":2,\"cmdCode\":2001}", ObdDataVo::class.java)
        val res = obdDataMapper.selectAll()
        res.forEach {
            println(it.obdVin)
            println(it.obdTime)
        }
        println(map.obdVin)
        println(map.obdProtocol)
        println(map.cmdCode)
    }
}