I have a gradle build whose final output is a zip file. I need to use this artifact in my test. How can I configure my gradle build so that my test classes can see this build artifact as a test resource?
I’m using ‘org.unbroken-dome.test-sets’ plugin to create a new “sourceset” called “integrationTest”. This way, I can have following structure, in addition to regular file/folder convention
The plugin also provides a task name using the new sourceset. So, I can type “gradlew integrationTest” to run my test cases from
src/integrationTest/groovy/... directory. All of this is working fine and my test cases can also use resources needed from the
Now, I need to enhance the test cases to use one of the build artifact as a test resource. Obviously, this build artifact is generated after a successful build is run by executing
gradlew clean build. But, I’m not sure how or if it’s possible for gradle to configure so that the “integrationTest” source set can have resources from both
src/integrationTest/resource as well as a build artifact.