I've created a new spring boot 1.4 application, want to try some testing using @DataJpaTest but keep getting the following error message
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot determine embedded database for tests. If you want an embedded database please put a supported one on the classpath.
src/main/resources/application.properties
spring.datasource.url=jdbc:mysql://localhost/my_db
spring.datasource.username=user
spring.datasource.password=password
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
MyRepositoryTest
@RunWith(SpringRunner.class)
@DataJpaTest
final public class MyRepositoryTest {
}
build.gradle
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web',
'org.springframework.boot:spring-boot-starter-data-jpa',
'mysql:mysql-connector-java',
'org.projectlombok:lombok:1.16.10'
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Any ideas what i am doing wrong?