@Test
public void testSerde() throws IOException
{
HashMap<String, Boolean> feature = new HashMap<String, Boolean>();
feature.put("ALLOW_UNQUOTED_CONTROL_CHARS", true);
JSONParseSpec spec = new JSONParseSpec(
new TimestampSpec("timestamp", "iso", null),
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("bar", "foo")), null, null),
null,
feature
);
final JSONParseSpec serde = (JSONParseSpec) jsonMapper.readValue(
jsonMapper.writeValueAsString(spec),
ParseSpec.class
);
Assert.assertEquals("timestamp", serde.getTimestampSpec().getTimestampColumn());
Assert.assertEquals("iso", serde.getTimestampSpec().getTimestampFormat());
Assert.assertEquals(Arrays.asList("bar", "foo"), serde.getDimensionsSpec().getDimensionNames());
Assert.assertEquals(feature, serde.getFeatureSpec());
}
}