Use new transaction wrappers.

This commit is contained in:
akwizgran
2023-01-20 13:35:12 +00:00
parent e52250f1e4
commit 2eef34f424
2 changed files with 13 additions and 33 deletions

View File

@@ -137,17 +137,14 @@ public class FeedManagerImplTest extends BrambleMockTestCase {
Message msg = getMessage(blogGroupId);
BlogPost post = new BlogPost(msg, null, localAuthor);
context.checking(new Expectations() {{
oneOf(db).startTransaction(false);
will(returnValue(txn));
context.checking(new DbExpectations() {{
oneOf(db).transactionWithResult(with(false), withDbCallable(txn));
oneOf(clock).currentTimeMillis();
will(returnValue(42L));
oneOf(blogPostFactory).createBlogPost(feed.getBlogId(), 42L, null,
localAuthor, text);
will(returnValue(post));
oneOf(blogManager).addLocalPost(txn, post);
oneOf(db).commitTransaction(txn);
oneOf(db).endTransaction(txn);
}});
feedManager.postFeedEntries(feed, entries);
}