@Test
  public void testPrimitiveDataTypes() throws Exception {
    Properties props = new Properties();
    props.setProperty(serdeConstants.LIST_COLUMNS,
        "name,height,weight,endangered,born");
    props.setProperty(serdeConstants.LIST_COLUMN_TYPES,
        "string,float,int,boolean,timestamp");
    props.setProperty(serdeConstants.TIMESTAMP_FORMATS, "millis");

    JsonSerDe serde = new JsonSerDe();
    serde.initialize(new Configuration(), props, null, false);

    final String jsonText = loadJson("simple.json");

    final Text text = new Text(jsonText);
    final List<?> results = (List<?>) serde.deserialize(text);

    Assert.assertNotNull(results);
    Assert.assertEquals(5, results.size());
    Assert.assertEquals("giraffe", results.get(0));
    Assert.assertEquals(5.5f, results.get(1));
    Assert.assertEquals(1360, results.get(2));
    Assert.assertEquals(true, results.get(3));
    Assert.assertEquals(Timestamp.ofEpochMilli(1549751270013L), results.get(4));
  }
Test suite for the JSON SerDe class.
serde/src/test/org/apache/hadoop/hive/serde2/TestJsonSerDe.java