+
+ @Test(expected = AssertionFailedError.class)
+ public void testTransactionNotCommittedUnexpectedly() throws Exception {
+ builder.execute(new JpaUnitOfWork<Void>() {
+ public Void execute(EntityManager aEm) {
+ MyEntity entity = new MyEntity("a", "b");
+ aEm.persist(entity);
+ aEm.getTransaction().rollback();
+ return null;
+ }
+ });
+ }
+