When i analyzed my project by Sonarquebe , Sonar report showing code smell in test classes in java

Sonar report showing code smell in test classes in java project,
When i used below configuration so code smell in test classes in java project
<sonar.sources>src/main/java</sonar.sources>
<sonar.tests>src/test/java</sonar.tests>
<sonar.exclusions>/test/</sonar.exclusions>
<sonar.junit.reportsPath>target/surefire-reports/</sonar.junit.reportsPath>

But when i used below configuration so Unit test count shown “_”

<sonar.sources>src/main/java</sonar.sources>
<sonar.test.exclude>/test/</sonar.test.exclude>
<sonar.junit.reportsPath>target/surefire-reports/</sonar.junit.reportsPath>

Hi,

Welcome to the community!

Yes, exactly! :smiley:

There are rules that are written to check the functionality & logic of your tests, so this is working as expected. If you really don’t want issues raised on tests, you can disable those rules.

 
HTH,
Ann