Gradle all the way down: Testing your Gradle plugin with Gradle TestKit

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • dear-github-2.0

    📨 An open letter to GitHub from the maintainers of open source projects

    All the code below is available on Github.

  • dependency-analysis-gradle-plugin

    Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins

    Added a new test suite, named "functionalTest", and configured it to use the Spock test framework, along with three dependencies: Truth, TestKit-Truth, and the project itself. This reveals the interesting point that, by default, new test suites don't have the project under test on the classpath, which enables true black box testing if you're into that kind of thing.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • blog-gradle-all-the-way-down

    Companion source for "Gradle all the way down" blog post

    For brevity, I will not discuss how the unit tests work in the sample repo. Instead, I encourage you to take a look if you're curious. Bottom line: exactly like you'd expect, with maybe the small exception that it uses JUnit5 rather than 4. I've included it primarily to demonstrate the possibility and utility of maintaining multiple test suites that each serve different purposes.

  • Truth

    Fluent assertions for Java and Android

    Configured the default test suite (named "test", i.e., the "unit tests") to use the JUnit5 (aka JUnit Jupiter) test framework, and to add Truth as a testImplementation dependency.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts