generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhislin
committed
Dec 29, 2024
1 parent
015ea8d
commit 83e462a
Showing
1 changed file
with
29 additions
and
16 deletions.
There are no files selected for viewing
45 changes: 29 additions & 16 deletions
45
src/main/resources/inspectionDescriptions/UnittestCaseAnnotationInspection.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,40 @@ | ||
<html> | ||
<body> | ||
Write your description here. | ||
Start the description with a verb in 3rd person singular, like reports, detects, highlights. | ||
In the first sentence, briefly explain what exactly the inspection helps you detect. | ||
Make sure the sentence is not very long and complicated. | ||
<p> | ||
The first sentence must be in a dedicated paragraph separated from the rest of the text. This will make the | ||
description easier to read. | ||
Make sure the description doesn’t just repeat the inspection title. | ||
</p> | ||
Reports missing or improperly formatted unit test annotations and documentation in JUnit test methods. | ||
|
||
<p> | ||
See https://plugins.jetbrains.com/docs/intellij/inspections.html#descriptions for more information. | ||
This inspection verifies that test methods have proper test case management annotations and contain both step and assert comments | ||
to document test behavior. It helps maintain consistent test documentation and improves test maintainability. | ||
</p> | ||
|
||
<p> | ||
Embed code snippets: | ||
The inspection checks for: | ||
<ul> | ||
<li>Presence of required test case management annotations</li> | ||
<li>Presence of "step" comments describing test steps</li> | ||
<li>Presence of "assert" comments describing expected outcomes</li> | ||
</ul> | ||
</p> | ||
|
||
<p>Example of a properly documented test method:</p> | ||
<pre><code> | ||
// automatically highlighted according to inspection registration 'language' attribute | ||
@Test | ||
@TestCaseAnnotation | ||
public void testFeature() { | ||
// Step: Initialize test data | ||
String input = "test"; | ||
|
||
// Step: Execute the method under test | ||
String result = feature.process(input); | ||
|
||
// Assert: Verify the expected outcome | ||
assertEquals("expected", result); | ||
} | ||
</code></pre> | ||
<!-- tooltip end --> | ||
<p>Text after this comment will only be shown in the settings of the inspection.</p> | ||
|
||
<p>To open related settings directly from the description, add a link with `settings://$` optionally followed by `?$` to | ||
pre-select a UI element.</p> | ||
<!-- tooltip end --> | ||
<p> | ||
Configure annotation schemas and requirements in Settings | Editor | Unittest Annotation Configuration. | ||
</p> | ||
</body> | ||
</html> |