[ 
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:24 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 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 
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
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to