Spring Boot default test throws an IllegalStateException

Make sure you have connection properties in the application.properties

For eg.

spring.datasource.url=jdbc:mysql://localhost/database
spring.datasource.username=username
spring.datasource.password=password
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

I had a similar issue, but using Spring Initializr with the JPA module. What happens is that in the pom.xml generated there is no dependency declared for any embedded database. This makes the context loading process fail during the test phase.

To fix you can simply add the following dependency to your pom.xml:

<dependency>
    <groupId>org.hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <scope>runtime</scope>
</dependency>

However I thought it would be nice to have such dependency by default, so I have opened a (trivial) issue at Spring:

https://jira.spring.io/browse/DATAJPA-1461

I hope I have submitted to the right board.