Executing ./gradlew build in an empty project (3.4.1 version) produces:
> Task :test FAILED
DemoApplicationTests > contextLoads() FAILED
java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:180
Caused by: org.springframework.beans.factory.BeanCreationException at AbstractBeanFactory.java:325
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:804
Caused by: org.springframework.beans.factory.BeanCreationException at ConstructorResolver.java:657
Caused by: org.springframework.beans.BeanInstantiationException at SimpleInstantiationStrategy.java:199
Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException at DataSourceProperties.java:186
1 test completed, 1 failed
FAILURE: Build failed with an exception.
The failed test is generated automatically.
To reproduce, you can use this project; also, the error can be observed in a freshly generated project with such a config:
Comment From: snicoll
If you're complaining that start.spring.io is generating a project whose default test fails, this isn't the right place to do so. For the record, you should not expect every available combinations to work out of the box. Some have requirements that can be added after the project is generated, or if you start the app, it'll fail in a way to guide you in what's missing.
In your case, you want to use JPA but you didn't tell which database to use and the starter won't provide one. If you use ./gradlew bootRun on your app, it fails (as it should) as follows:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).