szaszm commented on a change in pull request #1107:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1107#discussion_r676610424



##########
File path: extensions/windows-event-log/tests/BookmarkTests.cpp
##########
@@ -40,7 +40,10 @@ std::unique_ptr<Bookmark> createBookmark(TestPlan &test_plan,
                                          const utils::Identifier &uuid = 
IdGenerator::getIdGenerator()->generate()) {
   const auto state_manager = 
test_plan.getStateManagerProvider()->getCoreComponentStateManager(uuid);
   const auto logger = test_plan.getLogger();
-  return utils::make_unique<Bookmark>(channel, L"*", "", uuid, false, 
state_manager, logger);
+  state_manager->beginTransaction();
+  auto bookmark = utils::make_unique<Bookmark>(channel, L"*", "", uuid, false, 
state_manager, logger);
+  state_manager->commit();

Review comment:
       Could we somehow make this easier to use correctly and hard/impossible 
to use incorrectly? I'm thinking about transaction objects having state 
mutating capabilities, and the state manager only handing them out. onTrigger 
could get one as an argument.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to