Hey all,
I have problem with the code coverage of me project.
The thing is that the regex " ^((Test|IT)[a-zA-Z0-9]+|[A-Z][a-zA-Z0-9]*(Test|IT|TestCase|ITCase))$"
for class naming convention doesnt recognise my test classes (ex:OrderServiceIT.java).
It works if I have ‘Test’ at the end of the file.
Can someone can have idea what is the problem, i dont want to reneame all the IT test classes in order to resolve this problem.
Hello @Riste_L,
This is strange, because your class name actually matches the regular expression of the rule.
I used the Online regex tester
And tried
Regular Expression: ^((Test|IT)[a-zA-Z0-9]+|[A-Z][a-zA-Z0-9]*(Test|IT|TestCase|ITCase))$
Test String: OrderServiceIT
Is your example class name correct?
On the other hand: The rule is a “Code Smell” ranked as “Minor” - the least important issue you can have in SonarQube . The rule is also not in the default quality profiles.
So you seem to have very strict coding rules in your team. Think about deactivating the rule and have some relief for your Developers.
Yes that is the correct name of the class. I have also checked that the name matches the regular expression , so that is why it looks very strange to me.
Indeed i will try to deactivate this rule, I am new to sonarCloud and I also need to do some investigation on that part(configuration settings)