[
https://issues.apache.org/jira/browse/NIFI-14153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17912613#comment-17912613
]
Daniel Stieglitz edited comment on NIFI-14153 at 1/13/25 10:30 PM:
-------------------------------------------------------------------
I discovered that this rule does have some limitations. These are the
limitations I noticed even though Intellij actually flags them:
* This rule does not discover cases where assertTrue can be simplified with
assertArrayEquals e.g. TestSchemaRecordReaderWriter on line 155.
* This rule does not discover cases where assertTrue(someObject instanceof
someClass) can be replaced with assertInstanceOf e.g. AuthorizerFactoryTest
line 266.
* This rule does not discover cases where
assertTrue(someClass.isIstanceof(someObject)) could be replaced with
assertInstanceOf. e.g. TestAvroTypeUtil lines 913 and 914.
For all three of the above cases I manually searched for instances of these
cases and made the appropriate replacements.
was (Author: JIRAUSER294662):
I discovered that this rule does have some limitations. These are the
limitations I noticed even though Intellij actually flags them:
* This rule does not discover cases where assertTrue can be simplified with
assertArrayEquals e.g. TestSchemaRecordReaderWriter on line 155.
* This rule does not discover cases where assertTrue(someObject instanceof
someClass) can be replaced with assertInstanceOf e.g. AuthorizerFactoryTest
line 266.
* This rule does not discover cases where
assertTrue(someClass.isIstanceof(someObject)) could be replaced with
assertInstanceOf. e.g. TestAvroTypeUtil lines 913 and 914.
For all three of the above cases I manually searched for these cases and made
the appropriate replacements.
> Apply PMD's SimplifiableTestAssertion across the code base
> ----------------------------------------------------------
>
> Key: NIFI-14153
> URL: https://issues.apache.org/jira/browse/NIFI-14153
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Daniel Stieglitz
> Assignee: Daniel Stieglitz
> Priority: Minor
>
> More information regarding this PMD rule can be found
> [here|https://pmd.github.io/pmd/pmd_rules_java_bestpractices.html#simplifiabletestassertion]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)