SONARJAVA-5291 Modify rule S7177: specify spring context (#4623)
This commit is contained in:
parent
1e62d9fef8
commit
8940eee53e
@ -1,6 +1,6 @@
|
||||
== Why is this an issue?
|
||||
|
||||
The `@DirtiesContext` annotation marks the ApplicationContext as dirty and indicates that it should be cleared and recreated.
|
||||
In a Spring application, the `@DirtiesContext` annotation marks the ApplicationContext as dirty and indicates that it should be cleared and recreated.
|
||||
This is important in tests that modify the context, such as altering the state of singleton beans or databases.
|
||||
|
||||
Misconfiguring `@DirtiesContext` by setting the `methodMode` at the class level or the `classMode` at the method level will make the annotation have no effect.
|
||||
@ -39,4 +39,4 @@ public class TestClass {
|
||||
|
||||
=== Documentation
|
||||
|
||||
* Spring documentation - https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/annotation/DirtiesContext.html[@DirtiesContext]
|
||||
* Spring documentation - https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/annotation/DirtiesContext.html[@DirtiesContext]
|
||||
|
Loading…
x
Reference in New Issue
Block a user