[ 
https://issues.apache.org/jira/browse/SLING-13052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18051111#comment-18051111
 ] 

Bhavik Kothari commented on SLING-13052:
----------------------------------------

Adding explicit assertion {{Assert.assertTrue(maxInstances > 0)}} to 
AdapterFactoryTest to resolve SonarQube blocker.

This will ensure the clean-up verification loop successfully calculates a valid 
number of iterations to run. 

> [SONAR] Add missing assertions to AdapterFactoryTest (java:S2699)
> -----------------------------------------------------------------
>
>                 Key: SLING-13052
>                 URL: https://issues.apache.org/jira/browse/SLING-13052
>             Project: Sling
>          Issue Type: Test
>          Components: Sling Models
>            Reporter: Bhavik Kothari
>            Priority: Major
>
> *SonarCloud Issue:* 
> [java:S2699](https://rules.sonarsource.com/java/RSPEC-2699/) - Tests should 
> include assertions
> *Location:* 
> src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java : (L310)
> *Problem:*
> SonarCloud flagged `AdapterFactoryTest` for having test methods without 
> assertions. These tests currently only verify that no exception is thrown but 
> do not validate the actual logic.
> *Proposed Fix:*
> Add `assertNotNull`, `assertEquals` calls to the affected test methods to 
> ensure proper validation.
> *Reference:*
> https://sonarcloud.io/project/issues?impactSeverities=BLOCKER&issueStatuses=OPEN%2CCONFIRMED&id=apache_sling-org-apache-sling-models-impl&open=AWo5WyPDyRjJygCrF7Ae&tab=why



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

Reply via email to