When I use @JdbcTest, or @DataJpaTest or @SpringBootTest in a test, a JdbcTemplate bean and a NamedParameterJdbcTemplate bean is automatically created 👍. This is very handy: i can use these beans in my test code.
Is it possible to also create a JdbcClient bean ?
Comment From: quaff
Have you tried v3.2.0-M2? It should be fixed by https://github.com/spring-projects/spring-boot/issues/36579 .
Comment From: hansdesmet
I tried today with 3.2.0-SNAPSHOT. I think the JdbcClient bean is created when you run your application, not when you test your application (with @JdbcTest).
Comment From: sivaprasadreddy
I tried with both 3.2.0-M2 and 3.2.0-SNAPSHOT, not working. See https://github.com/spring-projects/spring-boot/issues/37114 for a reproducer.
Comment From: quaff
It should be fixed by https://github.com/spring-projects/spring-boot/pull/37122
Comment From: hansdesmet
I put a project on https://github.com/hansdesmet/jdbctestmakesnojdbcclientbean with a JUnit test which shows the problem.
Comment From: mhalbritter
Superseded by #37122.
Comment From: wilkinsona
@hansdesmet adding @ImportAutoConfiguration(JdbcClientAutoConfiguration.class) to your tests should work around the current lack of support.