#include "processors/ListenHTTP.h" #include "processors/LogAttribute.h" TEST_CASE("HTTPTestsWithNoResourceClaimPOST", "[httptest1]") { TestController testController; std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>(); LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::InvokeHTTP>(); std::shared_ptr<TestRepository> repo = std::make_shared<TestRepository>(); std::shared_ptr<core::Processor> getfileprocessor = std::make_shared<org::apache::nifi::minifi::processors::GetFile>("getfileCreate2"); std::shared_ptr<core::Processor> logAttribute = std::make_shared<org::apache::nifi::minifi::processors::LogAttribute>("logattribute"); char format[] = "/tmp/gt.XXXXXX"; char *dir = testController.createTempDirectory(format); std::shared_ptr<core::Processor> listenhttp = std::make_shared<org::apache::nifi::minifi::processors::ListenHTTP>("listenhttp"); std::shared_ptr<core::Processor> invokehttp = std::make_shared<org::apache::nifi::minifi::processors::InvokeHTTP>("invokehttp"); uuid_t processoruuid; REQUIRE(true == listenhttp->getUUID(processoruuid)); uuid_t invokehttp_uuid; REQUIRE(true == invokehttp->getUUID(invokehttp_uuid)); std::shared_ptr<minifi::Connection> gcConnection = std::make_shared<minifi::Connection>(repo, content_repo, "getfileCreate2Connection"); gcConnection->setRelationship(core::Relationship("success", "description")); std::shared_ptr<minifi::Connection> laConnection = std::make_shared<minifi::Connection>(repo, content_repo, "logattribute"); laConnection->setRelationship(core::Relationship("success", "description"));
#include "LogAttribute.h" #include "GetFile.h" TEST_CASE("GetFile: FIFO", "[getFileFifo]") { // NOLINT TestController testController; LogTestController::getInstance().setTrace<TestPlan>(); LogTestController::getInstance().setTrace<processors::GetFile>(); LogTestController::getInstance().setTrace<processors::LogAttribute>(); auto plan = testController.createPlan(); auto repo = std::make_shared<TestRepository>(); // Define directory for input std::string in_dir("/tmp/gt.XXXXXX"); REQUIRE(testController.createTempDirectory(&in_dir[0]) != nullptr); // Define test input file std::string in_file(in_dir); in_file.append("/testfifo"); // Build MiNiFi processing graph auto get_file = plan->addProcessor( "GetFile", "Get"); plan->setProperty( get_file, processors::GetFile::Directory.getName(), in_dir); plan->setProperty( get_file, processors::GetFile::KeepSourceFile.getName(),