Mark Payne created NIFI-2474:
--------------------------------
Summary: TestRunner should not expose a VariableRegistry construct
Key: NIFI-2474
URL: https://issues.apache.org/jira/browse/NIFI-2474
Project: Apache NiFi
Issue Type: Improvement
Components: Tools and Build
Reporter: Mark Payne
Fix For: 1.0.0
Currently, the TestRunners class provides a mechanism for creating a TestRunner
that takes in a Variable Registry. The concept of providing variables to the
Test Runner is very valuable. However, the notion of the VariableRegistry is an
internal implementation detail that is getting exposed, creating a leaky
abstraction.
We should remove the override of the createTestRunner() method that takes the
Variable Registry and instead expose a set of methods of TestRunner:
void setVariable(String name, String value)
String getVariable(String name)
void setVariables(Map<String, String> variables)
Map<String, String> getVariables()
Additionally, as-is, if no VariableRegistry is provided, the default is to use
a Variable Registry that provides System and Environment variables. This should
be avoided, as it encourages unit tests to depend on environment-specific
settings.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)