mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2424 Preserve using PersistenceException when transaction register(Callback) called with no active transaction
This commit is contained in:
1 parent
4d34c9e868
commit
fcda419abb
2 files changed
+7
-3
No files matched your search
@@ -72,12 +72,12 @@ public class TestTransactionCallback extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void test_noActiveTransaction() {
|
||||
assertThrows(NullPointerException.class, () -> DB.register(new MyCallback()));
|
||||
assertThrows(PersistenceException.class, () -> DB.register(new MyCallback()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_noActiveTransaction_withDatabase() {
|
||||
assertThrows(NullPointerException.class, () -> DB.getDefault().register(new MyCallback()));
|
||||
assertThrows(PersistenceException.class, () -> DB.getDefault().register(new MyCallback()));
|
||||
}
|
||||
|
||||
class MyCallback extends TransactionCallbackAdapter {
|
||||
|
||||
Reference in new issue
Block a user