NIFI-14808 Introduce MockParameterLookup class for parameters passing#10159
NIFI-14808 Introduce MockParameterLookup class for parameters passing#10159exceptionfactory merged 1 commit intoapache:mainfrom
Conversation
0d5cd6a to
db7c5cb
Compare
sfc-gh-dhandermann
left a comment
There was a problem hiding this comment.
Thanks for proposing this improvement @kubaugust. Most of the changes look straightforward. The only concern I noted is the ambiguity of the two-argument constructor. Although the MockValidationContext has minimal direct use in the project, it could also be used outside, and requiring the disambiguation is not optimal for compatibility. Eliminating that and simply supporting the three-argument constructor with the ParameterLookup instance should resolve both issues. That should remove the need to change other classes as well, so those changes can be reverted.
| this(processContext, stateManager, ParameterLookup.EMPTY); | ||
| } | ||
|
|
||
| public MockValidationContext(final MockProcessContext processContext, final Map<String, String> parameters) { |
There was a problem hiding this comment.
Although the Map<String, String> of parameters is convenient, it is not necessarily intuitive for all use cases, so I recommend removing this constructor. Removing it also eliminates the need to disambiguate existing usage of null for the StateManager.
There was a problem hiding this comment.
Thanks David for noticing! Indeed, this might be a bit unintuitive... Removed this constructor
51e8436 to
d00fd46
Compare
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for this addition to the nifi-mock library @kubaugust, the latest version looks good! +1 merging
Summary
NIFI-14808
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation