spring Should I use @DirtiesContext on every class
问题 I have several junit tests, @ContextConfiguration(locations = { "file:../business/src/test/resources/application-context-test.xml", "file:src/main/webapp/WEB-INF/confA.xml", "classpath:/mvc-dispatcher-servlet-test.xml"}) @WebAppConfiguration @RunWith(SpringJUnit4ClassRunner.class) public class ProductContentControllerTest { ... } Inside a class all tests have to run in the same context (which is the case). But I want all my tests classes to be independent. I was assuming that it was the