TL;DR: As of SonarQube 10.6, and around the same time for SonarCloud, we started applying some of the main rules on to test code. See the announcement for more details.
hey @anon40266202,
Is this expected behaviour or is it a bug ?
Yes, it is the expected behavior. We recently started increasing the scope of some of our rules to run on Java test code. The effort is expected to continue throughout the year, reaching around 60 rules.
In general, these rules should help everyone keep a maintainable test suite.
In particular, S1130 can be particularly useful when you are used to working with IDEs that grey out the throws Exception
clause in the method signature when your test changes.
But, please let us know if you have any feedback on these changes.
Cheers,
Dorian