package com.mogo.test.json;


import com.elegant.network.utils.GsonUtil;
import com.mogo.v2x.data.V2XAdvanceWarning;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;


@RunWith(JUnit4.class)
public class V2XWarningFromGson {

    @Test
    public void testV2XWarningFromGson() {
        String s = "{\"distance\":0.0,\"gdLocusList\":[],\"heading\":0.0,\"laneNum\":0,\"level\":3,\"locusList\":[],\"objectId\":\"70970\",\"objectType\":3,\"position\":{\"lat\":40.19920411,\"lon\":116.7397},\"sn\":\"X2020211029Q24CLWL\",\"speed\":0.0,\"status\":1,\"threatLevel\":3,\"time\":0,\"typeId\":1003}";
        try {
            V2XAdvanceWarning warning = GsonUtil.objectFromJson(s, V2XAdvanceWarning.class);
            System.out.println("warning:" + warning.toString());
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
}
