public class FieldTest {
@Test
public void testNestedObjectParsing() throws Exception {
Map value = new ObjectMapper().readValue(getClass().getResourceAsStream("nested.json"), Map.class);
Field fl = Field.parseField(value);
assertEquals("artiststimestamp", fl.name());
Field[] properties = fl.properties();
Field first = properties[0];
assertEquals("date", first.name());
assertEquals(FieldType.DATE, first.type());
Field second = properties[1];
assertEquals(FieldType.OBJECT, second.type());
assertEquals("links", second.name());
Field[] secondProps = second.properties();
assertEquals("url", secondProps[0].name());
assertEquals(FieldType.STRING, secondProps[0].type());
}