concept test task in category gradle

This is an excerpt from Manning's book Gradle in Action - corrected 9052019.
When executing earlier examples, you may have noticed that the task graph contained four tasks that were always up to date and therefore skipped. This is because you hadn’t written any test code that Gradle would need to compile or execute. Figure 7.4 shows the test tasks provided by the Java plugin and how they fit into the existing order of tasks.
You’ve seen that TestNG support needs to be configured by calling the useTestNG() method. However, the default test task executes either JUnit or TestNG tests. To enable support for both, you’ll have to add a new task of class type Test. Name that task testNG. This new task can easily be integrated into the test lifecycle by making the test task depend on it, as shown in figure 7.6.
The result is a build that executes all three test class types. JUnit and Spock tests are executed by the test task, and TestNG tests are executed by the testNG task. The following listing demonstrates the minor change to your existing build that provides support for multiple frameworks in one build.