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


##########
extensions/standard-processors/tests/unit/FlowJsonTests.cpp:
##########
@@ -789,4 +808,118 @@ TEST_CASE("Dynamic properties can use parameters") {
   CHECK(value == "value1");
 }
 
+TEST_CASE("Test sensitive parameters in sensitive properties") {
+  ConfigurationTestController test_controller;
+  auto context = test_controller.getContext();
+  auto encrypted_parameter_value = 
minifi::utils::crypto::property_encryption::encrypt("value1", 
*context.sensitive_values_encryptor);
+  auto encrypted_sensitive_property_value = 
minifi::utils::crypto::property_encryption::encrypt("#{my_value}", 
*context.sensitive_values_encryptor);
+  core::flow::AdaptiveConfiguration config(context);
+
+  static const std::string CONFIG_JSON =
+      fmt::format(R"(
+{{
+  "parameterContexts": [
+    {{
+      "identifier": "721e10b7-8e00-3188-9a27-476cca376978",
+      "name": "my-context",
+      "description": "my parameter context",
+      "parameters": [
+        {{
+          "name": "my_value",
+          "description": "",
+          "sensitive": true,
+          "value": "{}"
+        }}
+      ]
+    }}
+  ],
+  "rootGroup": {{
+    "name": "MiNiFi Flow",
+    "processors": [{{
+      "identifier": "00000000-0000-0000-0000-000000000001",
+      "name": "MyProcessor",
+      "type": "org.apache.nifi.processors.DummyFlowJsonProcessor",
+      "schedulingStrategy": "TIMER_DRIVEN",
+      "schedulingPeriod": "3 sec",
+      "properties": {{
+        "Sensitive Property": "{}"
+      }}
+    }}],
+    "parameterContextName": "my-context"

Review Comment:
   Yes `parameterContextName` is inherited from NiFi, each process group is 
linked to a single parameter context using the parameter context name.



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