Spring: Why is @PreDestroy not called at end of each test class?
问题 I have an integration test class annotated as follows @WebAppConfiguration @ContextConfiguration(classes = {AppConfiguration.class}) @RunWith(SpringJUnit4ClassRunner.class) public class CacheConsumerTest { } Here's my AppConfiguration @Configuration @ComponentScan(basePackages = {"com.etc.etc.etc."}) @EnableWebMvc public class AppConfiguration { } For some reason, none of my @Component beans' @PreDestroy is getting called at the end of all tests in CacheConsumerTest . @PostConstruct is