lordgamez commented on code in PR #1840:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1840#discussion_r1810360499


##########
libminifi/test/libtest/unit/SingleProcessorTestController.h:
##########
@@ -52,25 +61,17 @@ class SingleProcessorTestController : public TestController 
{
 
   core::Relationship addDynamicRelationship(std::string name);
 
- private:
-  std::shared_ptr<core::FlowFile> createFlowFile(const std::string_view 
content, std::unordered_map<std::string, std::string> attributes);
+  template<typename T = core::Processor>
+  T* getProcessor() const { return static_cast<T*>(processor_); }

Review Comment:
   That's true, we shouldn't have a god class like FlowController here, but I'm 
not sure this change complicates the previous behavior. Previously we also had 
all the controllers and processors as part of the TestPlan, the only difference 
is that the exclusive ownership is now in the test plan instead of the shared 
ownership between the TestPlan and the test case. The change had to be made 
because controller services are now only valid on a process group level and 
both the processors and controllers had to be added to the same process group 
in the test scenarios to be able to retrieve the controllers in the scope of a 
processor that defines a controller in their processor properties. I think this 
was the least intrusive change to be able to use the processors and controllers 
in our test framework, of course we can redesign the TestBase, TestController 
and TestPlan, but I think that's out of the scope of this PR.



-- 
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