@Test(expected = AvroTypeException.class)
public void detectsInvalidDefault() throws JsonProcessingException, IOException {

  jsonNode = new ObjectMapper().readTree(
      "{\"type\":\"record\",\"name\":\"mine\",\"fields\":[{\"name\":\"str\",\"type\":\"int\",\"default\":\"0\"}]}");
  // "0" is invalid for int, it should instead be 0
  when(parser.readValueAsTree()).thenReturn(jsonNode);
  new SchemaDeserializer().deserialize(parser, null);
}