@Test public void testAddAttribute() { yawp.save(new BasicObject("xpto1")); Map<String, Object> map = yawp(BasicObject.class).<Map<String, Object>>transform("addAttribute").first(); assertEquals("xpto", map.get("attr")); }
@Test public void testTransformWithChild() { Parent parent = new Parent(); yawp.save(parent); Child child = new Child(); child.setName("xpto"); child.setParentId(parent.getId()); yawp.save(child); Child retrievedChild = yawp(Child.class).<Child>transform("simple").first(); assertEquals("transformed xpto", retrievedChild.getName()); }