While running default Spring Boot unit test:
@SpringBootTest
class DemoH2FlywayApplicationTests {
@Test
void contextLoads() {
}
}
I am getting this error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource
I am running Spring Boot 2.6.2, using Flyway and H2, and these dependencies:
spring-boot-starter-data-jdbc
spring-boot-starter-data-jpa
spring-boot-starter-web
flyway-core
spring-boot-devtools
h2
lombok
spring-boot-starter-test
Here is the demo project: https://github.com/filip194/demo-h2-flyway/.
I am not sure, nor expert, but maybe there is some correlation with Hibernate that I can not understand. I have tried to create test resources folder with application.properties for H2, the same as in the main resources, but nothing changes.
Can anybody help?