@Test(groups = "fast") public void testDeserialization() throws Exception { // See https://dev.recurly.com/docs/list-account-notes final String accountNotesData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<notes type=\"array\">\n" + " <note>" + " <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\"/>" + " <message>This is my second note</message>" + " <created_at type=\"datetime\">2015-06-14T16:08:41Z</created_at>" + " </note>" + " <note>" + " <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\"/>" + " <message>This is my first note</message>" + " <created_at type=\"datetime\">2016-06-13T16:06:21Z</created_at>" + " </note>" + " <!-- Continued... -->" + "</notes>"; final AccountNotes accountNotes = xmlMapper.readValue(accountNotesData, AccountNotes.class); Assert.assertEquals(accountNotes.size(), 2); final AccountNote note = accountNotes.get(0); Assert.assertEquals(note.getMessage(), "This is my second note"); Assert.assertEquals(note.getCreatedAt(), new DateTime("2015-06-14T16:08:41Z")); final AccountNote note1 = accountNotes.get(1); Assert.assertEquals(note1.getMessage(), "This is my first note"); Assert.assertEquals(note1.getCreatedAt(), new DateTime("2016-06-13T16:06:21Z")); } }
@Test(groups = "fast") public void testDeserialization() throws Exception { // See https://dev.recurly.com/docs/list-account-notes final String accountNotesData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<notes type=\"array\">\n" + " <note>" + " <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\"/>" + " <message>This is my second note</message>" + " <created_at type=\"datetime\">2015-06-14T16:08:41Z</created_at>" + " </note>" + " <note>" + " <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\"/>" + " <message>This is my first note</message>" + " <created_at type=\"datetime\">2016-06-13T16:06:21Z</created_at>" + " </note>" + " <!-- Continued... -->" + "</notes>"; final AccountNotes accountNotes = xmlMapper.readValue(accountNotesData, AccountNotes.class); Assert.assertEquals(accountNotes.size(), 2); final AccountNote note = accountNotes.get(0); Assert.assertEquals(note.getMessage(), "This is my second note"); Assert.assertEquals(note.getCreatedAt(), new DateTime("2015-06-14T16:08:41Z")); final AccountNote note1 = accountNotes.get(1); Assert.assertEquals(note1.getMessage(), "This is my first note"); Assert.assertEquals(note1.getCreatedAt(), new DateTime("2016-06-13T16:06:21Z")); } }