I had this happen because my tests were not in the same package as my components. (I had renamed my component package, but not my test package.) And I was using @ComponentScan
in my test @Configuration
class, so my tests weren't finding the components on which they relied.
So, double check that if you get this error.