String recordJson =
"{\"type\":\"record\", \"name\":\"Foo\", \"fields\":[{\"name\":\"f\", "
+"\"type\":"+schemaJson+", "
+"\"default\":"+defaultJson+"}]}";
Schema expected = Schema.parse(recordJson);
DatumReader in = new GenericDatumReader(ACTUAL, expected);
GenericData.Record record = (GenericData.Record)
in.read(null, new BinaryDecoder(new ByteArrayInputStream(new byte[0])));
assertEquals("Wrong default.", defaultValue, record.get("f"));
assertEquals("Wrong toString", expected, Schema.parse(expected.toString()));
}