public void testSerializationSimple() throws Exception
{
final String dataSource = "billy";
final Interval interval = new Interval(new DateTime().minus(1000), new DateTime());
DefaultObjectMapper jsonMapper = new DefaultObjectMapper();
VersionConverterTask task = VersionConverterTask.create(dataSource, interval);
Task task2 = jsonMapper.readValue(jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(task), Task.class);
Assert.assertEquals(task, task2);
DataSegment segment = new DataSegment(
dataSource,
interval,
new DateTime().toString(),
ImmutableMap.<String, Object>of(),
ImmutableList.<String>of(),
ImmutableList.<String>of(),
new NoneShardSpec(),
9,
102937
);
task = VersionConverterTask.create(segment);
task2 = jsonMapper.readValue(jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(task), Task.class);
Assert.assertEquals(task, task2);
}