Fix for #226 - Json - support parsing json with unknown bean properties

This commit is contained in:
rbygrave committed 2014-12-19 00:01:02 +13:00
1 parent e0159ccb4f
commit a998c0be55
3 files changed
+36 -18

No files matched your search

@@ -50,6 +50,16 @@ public class JsonContextTest {
assertEquals("Jim", ((Customer) bean).getName());
}
@Test
public void test_unknownProperty() {
String jsonWithUnknown = "{\"id\":42,\"unknownProp\":\"foo\",\"name\":\"rob\",\"version\":1}";
Customer customer = Ebean.json().toBean(Customer.class, jsonWithUnknown);
assertEquals(Integer.valueOf(42), customer.getId());
assertEquals("rob", customer.getName());
}
@Test
public void testCreateGenerator() throws Exception {