SONARJAVA-6330: Implement S8692 - The system clock should not be used in tests#5611
Conversation
a264a6e to
add8e7f
Compare
SummaryThis PR implements a new SonarQube rule S8692: "The system clock should not be used in unit tests." The implementation adds a check that detects non-deterministic code in test files that relies on the system clock. It flags:
Compliant alternatives include using What reviewers should knowCore files to review:
Documentation:
Test expectations:
Start here: Review
|
|
Agentic Analysis: Early ResultsAgentic Analysis and Context Augmentation are available on your project. Here are some issues that could have been prevented. Follow the links to learn how to put them into action. 24 issue(s) found across 1 file(s):
Analyzed by SonarQube Agentic Analysis in 5.5 s |
a5810bd to
acd3409
Compare
9461789 to
a898d7b
Compare
NoemieBenard
left a comment
There was a problem hiding this comment.
I think we should also add the java.util.Calendar getInstance method as you did for new Date()
937328e to
0cf6044
Compare
There was a problem hiding this comment.
The only change since the last review is adding three more expected violations to the commons-beanutils ruling snapshot — a mechanical update with nothing substantive to review. The highlight-range inconsistency flagged in the previous two rounds is still unaddressed.
|




No description provided.