@Test public void testCreateAndManageChild() { TestEntity result = entity.createAndManageChild(TestEntity.Spec.newInstance()); assertIsProxy(result); assertIsProxy(Iterables.get(entity.getChildren(), 0)); assertIsProxy(result.getParent()); assertIsProxy(managementContext.getEntityManager().getEntity(result.getId())); }
@Test public void testGetChildrenAndParentsReturnsProxies() { TestEntity child = (TestEntity) Iterables.get(app.getChildren(), 0); Application parent = (Application) child.getParent(); assertIsProxy(child); assertIsProxy(parent); }