[
https://issues.apache.org/jira/browse/NIFI-14312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Handermann resolved NIFI-14312.
-------------------------------------
Fix Version/s: 2.3.0
Resolution: Fixed
> Improvements to TestIdentifyMimeType
> ------------------------------------
>
> Key: NIFI-14312
> URL: https://issues.apache.org/jira/browse/NIFI-14312
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Daniel Stieglitz
> Assignee: Daniel Stieglitz
> Priority: Minor
> Fix For: 2.3.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> There are a few areas of duplicate code which can be cleaned up, there is
> ability to make paramaterized tests and various Intellij suggestions to
> address as well.
> The duplicate code issues which can be cleaned up are:
> # The declaration of TestRunners.newTestRunner(new IdentifyMimeType()); in
> each of the tests. A private variable can be made and instantiated in a
> method annotated with Junit 5 BeforeEach annotation.
> # Retrieval of the test files is duplicated five times. In addition, the
> logic to filter out directories can be included in the filter used in
> listFiles.
> Any of the tests which test against all the test files namely testFiles,
> testReplaceWithConfigBody, testReplaceWithConfigFile, testMergeWithConfigBody
> and testMergeWithConfigFile can be converted to paramaterized tests.
> The Intellij suggestions are
> # Class variable CONFIG_BODY value which is concatenated, can be replaced
> with text block line 40
> # get(0) call on java.util.List can be replaced with getFirst line 124
> # Lambda can be replaced with method reference lines 409 and 421
--
This message was sent by Atlassian Jira
(v8.20.10#820010)