mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix for #226 - Json - support parsing json with unknown bean properties
This commit is contained in:
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user