See `https://github.com/spring-projects/spring-boot/issues/7439`. `@MockitoBean`-based integration test can be used to validate this case.