2v0-7222 Exam QuestionsBrowse all questions from this exam

2v0-7222 Exam - Question 63


Refer to the exhibit.

What statement is true about @DirtiesContext?

Show Answer
Correct Answer: B

The @DirtiesContext annotation in a Spring test will close the existing cached ApplicationContext and recreate a new one after the test method. This ensures that changes made during the test do not affect subsequent tests, thereby providing a clean application context for the following tests.

Discussion

1 comment
Sign in to comment
2211094Option: A
Jul 1, 2024

A is the correct answer. Here is reference: https://docs.spring.io/spring-framework/reference/testing/annotations/integration-spring/annotation-dirtiescontext.html