Issue 12428

Predicates in GBIF API appear unsuitable for Jackson deserialization

12428
Reporter: trobertson
Assignee: trobertson
Type: Bug
Summary: Predicates in GBIF API appear unsuitable for Jackson deserialization
Description: The GBIF API predicates do not deserialize but throw errors.
Priority: Blocker
Resolution: Fixed
Status: Closed
Created: 2012-12-04 12:07:38.919
Updated: 2013-12-17 15:16:52.298
Resolved: 2012-12-04 16:00:12.778


Author: trobertson@gbif.org
Created: 2012-12-04 12:09:00.954
Updated: 2012-12-04 12:09:00.954
        
In DownloadTest in the GBIF API, the following illustrates the problem:
{code}
  @Test
  public void testSerde() {
    ObjectMapper mapper = new ObjectMapper();
    Download d = new Download(new EqualsPredicate("a", "b"));
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
      mapper.writeValue(baos, d);
      baos.flush();
      Download d2 = mapper.readValue(baos.toByteArray(), Download.class);
      assertEquals(d, d2);

    } catch (Exception e) {
      fail(e.getMessage());
    } finally {
      Closeables.closeQuietly(baos);
    }
  }
{code}
    


Author: trobertson@gbif.org
Comment: with https://code.google.com/p/gbif-common-resources/source/detail?r=1218
Created: 2012-12-04 16:00:12.812
Updated: 2012-12-04 16:00:12.812