Class DirtiesContextBeforeModesTestExecutionListener

All Implemented Interfaces:
Ordered, TestExecutionListener

public class DirtiesContextBeforeModesTestExecutionListener extends AbstractDirtiesContextTestExecutionListener
TestExecutionListener which provides support for marking the ApplicationContext associated with a test as dirty for both test classes and test methods annotated with the @DirtiesContext annotation.

This listener supports test methods with the method mode set to BEFORE_METHOD and test classes with the class mode set to BEFORE_EACH_TEST_METHOD or BEFORE_CLASS. For support for AFTER modes, see DirtiesContextTestExecutionListener.

When merging TestExecutionListeners with the defaults, this listener will automatically be ordered before the DependencyInjectionTestExecutionListener; otherwise, this listener must be manually configured to execute before the DependencyInjectionTestExecutionListener.

Since:
4.2
Author:
Sam Brannen
See Also: