Currently I have the following build.gradle file:
apply plugin: \'java\'
sourceSets {
main {
java {
srcDir \'src/model\'
If you created your project with Spring Initializr, everything should be configured correctly and all you need to do is run...
./gradlew clean test --info
--info if you don't want to see test output.clean if you don't want to rerun tests that have already passed since the last change.Dependencies required in build.gradle for testing in Spring Boot...
dependencies {
compile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
For some reason the test runner doesn't tell you this, but it produces an HTML report in build/reports/tests/test/index.html.