szaszm commented on code in PR #1297:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1297#discussion_r871414055
##########
libminifi/test/SingleProcessorTestController.h:
##########
@@ -28,16 +28,13 @@
#include "core/Processor.h"
namespace org::apache::nifi::minifi::test {
-class SingleInputTestController : public TestController {
+class SingleProcessorTestController : public TestController {
public:
- explicit SingleInputTestController(const std::shared_ptr<core::Processor>&
processor)
+ explicit SingleProcessorTestController(const
std::shared_ptr<core::Processor>& processor)
: processor_{plan->addProcessor(processor, processor->getName())}
{}
- std::unordered_map<core::Relationship,
std::vector<std::shared_ptr<core::FlowFile>>>
- trigger(const std::string_view input_flow_file_content,
std::unordered_map<std::string, std::string> input_flow_file_attributes = {}) {
- const auto new_flow_file = createFlowFile(input_flow_file_content,
std::move(input_flow_file_attributes));
- input_->put(new_flow_file);
+ auto trigger() {
Review Comment:
I leave it up to you @martinzink.
I also wanted to further explain my mental model of processors as they
relate to the single operation argument: I think of processor runs as a
function call with possible internal state (and a very obscure calling
convention). If it's a ListenSyslog, then it doesn't take any arguments, and it
returns a number of syslog messages. If it's ReplaceText, then it takes text
and it returns text. In other words, while in the current implementation,
passing arguments may be different, in the mental model (or at least in mine),
it's a single step: one function call, just with wildly different parameters
and results. Internally, it should be separate, because
[SRP](https://en.wikipedia.org/wiki/Single-responsibility_principle), and I
think it already is, but on the interface, every one of these is a single
operation IMO.
--
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]