@DirtiesContext in Spring

@DirtiesContext is a test annotation which indicates that the  ApplicationContext associated with a test is dirty and should therefore be closed and removed from the context cache. Once the TestContext framework loads an  ApplicationContext  (or WebApplicationContext) for a test, that context is cached and reused for all subsequent tests that declare the same unique context configuration within the same test suite. For example, if TestClassA specifies {“app-config.xml”, “test-config.xml”} for the locations (or value) attribute of @ContextConfiguration, the … Continue reading @DirtiesContext in Spring