X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=test%2Fenterprise%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Ftest%2Fpersistence%2FJpaBuilder.java;h=48556cfafcecf1f55690db0ff6b23a000fa788d2;hb=83898516d61bfcd1f4e3a3ea79bb56f3877f4900;hp=d50ca76e10b92172d0a51e4caf8218f3b90e191d;hpb=4c176ce124f4478ae8781625fd1bc6d28a35e466;p=utils diff --git a/test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java b/test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java index d50ca76e..48556cfa 100644 --- a/test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java +++ b/test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java @@ -151,13 +151,18 @@ public class JpaBuilder implements TransactionResource { * passing it the entity manager. Use of this method saves a lot of typing * for applications. * + * This method requires the transaction to succeed. Otherwise the test will + * fail. See {@link #execute(JpaUnitOfWork, TransactionResultCallback)} and + * {@link RequireTransactionStatus} for more possibilities. + * * @param aWork * Work to execute. * * @return The return value of the execute method of the unit of work. */ public T execute(JpaUnitOfWork aWork) throws Exception { - return execute(aWork, new LoggingTransactionResultCallback(Level.INFO)); + return execute(aWork, new RequireTransactionStatus( + TransactionResult.COMMIT)); } /**