public class TestLifecyleAnnotatedBean extends BaseTestCase {
@Test
public void test() {
EBasicWithLifecycle bean = new EBasicWithLifecycle();
bean.setName("hello there");
Ebean.getServerCacheManager();
Ebean.save(bean);
Assert.assertEquals("prePersist,postPersist,", bean.getBuffer());
EBasicWithLifecycle beanWasLoaded = Ebean.find(EBasicWithLifecycle.class, bean.getId());
Assert.assertEquals("postLoad", beanWasLoaded.getBuffer().toString());
bean.setName("Changed");
Ebean.save(bean);
Ebean.delete(bean);