Testing REST API with Gradle base application a.k.a. running unit tests programitcally

Hi, I need to develop a simple command-line API tester. The idea is to ship a JAR file build with gradle, run the main class, pass username and password for authorization and get a nice report after testing finishes.

I wonder if it’s possible to: - Use spock as a compile dependency and write the tests using spock. - Generate a nice report from tests - same as gradle generates.

Summing up, I’d like to write tests in spock, pack them into a JAR file, run tests agains some instance of API and finally obtain a nice gradle-generated report. Is it possible?