Spring Boot 1.5.10.RELEASE `@SpyBean` doesn't work when `@DirtiesContext(classMode = BEFORE_EACH_TEST_METHOD)` is placed on the test class. Example: ```java @RunWith(SpringRunner.class) @SpringBootTest @DirtiesContext(classMode = BEFORE_EACH_TEST_METHOD) public class MyServiceTests { @Autowired private MyService myService; @SpyBean private SpyMe spyMe; @Test public void spyBean() { myService.serviceMethod(); verify(spyMe).someMethod(); // doesn't pass } } @Service public class MyService { @Autowired private SpyMe spyMe; public void serviceMethod() { spyMe.someMethod(); } } @Component public class SpyMe { public void someMethod() { System.out.println("SpyMe.someMethod() was called"); } } ``` If I remove `@DirtiesContext` or use other `classMode` (`AFTER_EACH_TEST_METHOD` for example) - test passes. MCVE: https://github.com/xak2000/spybean-dirtiescontext-bug