@Test
public void testUnionJsonString()
{
UnionObjectInspector unionInspector = ObjectInspectorFactory.getStandardUnionObjectInspector(ImmutableList.of(getInspector(InnerStruct.class)));
UnionObject union = new StandardUnionObjectInspector.StandardUnion((byte) 0, new InnerStruct(1, 2L));
String actual = toUtf8String(SerDeUtils.getJsonBytes(union, unionInspector));
String expected = "{\"0\":{\"intval\":1,\"longval\":2}}";
assertEquals(actual, expected);
}