Chapter 4: ImageRepository bean not found
HomeControllerTests gets me "ImageRepository bean not found". For me this version of annotation fixed the problem:
@MockBeans({ @MockBean(ImageService.class), @MockBean(ImageRepository.class) }) public class HomeControllerTests {
@Autowired
WebTestClient webClient;
@Autowired
ImageService imageService;
That's strange!
What version of Spring Boot are you using? The one supplied in the code, or did you upgrade.
Also, considering that Spring Boot 2.0 (the version in the book) is no longer supported, you may wish to take a peek at something a bit newer.
Check out => https://github.com/hacking-with-spring-boot/hacking-with-spring-boot-code
2.3.0.RELEASE
Yeah, the book’s code definitely hasn’t been upgraded to that version.