This sample uses Gradle as build tool in order to execute the Citrus tests.

Objectives

Citrus uses Maven internally for building software. But of course you can also integrate the Citrus tests in a Gradle
project. As the Citrus tests are nothing but normal JUnit or TestNG tests the integration in the Gradle build is very easy.

The Gradle build configuration is done in the build.gradle and settings.gradle files. Here we define the project name
and the project version.

rootProject.name ='citrus-sample-gradle'
group 'com.consol.citrus.samples'
version '2.6.3-SNAPSHOT'

Now as Citrus libraries are available on Maven central repository we add these repositories so Gradle knows how to download the required
Citrus artifacts.

Citrus stable release versions are available on Maven central. If you want to use the very latest next version as snapshot preview you need
to add the ConSol Labs snapshot repository which is optional. Now lets move on with adding the Citrus libraries to the project.

In the configuration class we are able to define Citrus components for usage in tests. As usual
we can autowire the endpoint components as Spring beans in the test cases.

@AutowiredprivateChannelEndpointtestChannelEndpoint;

Run

The sample application uses Gradle as build tool. So you can use the Gradle wrapper for compile, package and test the
sample with Gradle build.

gradlew clean build

This executes all Citrus test cases during the build and you will see Citrus performing some integration test logging output.
After the tests are finished build is successful and you are ready to go for writing some tests on your own.

If you just want to execute all tests you can call

gradlew clean check

Of course you can also start the Citrus tests from your favorite IDE.
Just start the Citrus test using the Gradle integration in IntelliJ, Eclipse or Netbeans.