From 282ba7a2f327c398b01d5b572f723f92046d95b2 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 27 Jul 2020 17:11:01 -0500 Subject: [PATCH] Ensure tests exist --- build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.gradle b/build.gradle index 540f933..578e26a 100644 --- a/build.gradle +++ b/build.gradle @@ -15,4 +15,13 @@ allprojects { dependencies { checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:0.0.23-SNAPSHOT" } + + // Ensure every test task has at least a single test + tasks.withType(Test).configureEach { + afterSuite { desc, result -> + if (result.testCount == 0) { + throw new IllegalStateException("No tests were found. Ensure that useJUnitPlatform was used.") + } + } + } } \ No newline at end of file