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 want to see test output.clean
if you want to re-run 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
.