Exam 2v0-7222 All QuestionsBrowse all questions from this exam
Question 63

Refer to the exhibit.

What statement is true about @DirtiesContext?

    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
2211094Option: A

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