We try to give you example projects as a good starting point for your very own Citrus testing project.
The Citrus sample applications try to demonstrate how Citrus works in different integration test scenarios. The projects are executable with Maven and should give you a detailed picture how Citrus testing works.
Please have a look at the repository on citrus-samples. There you can find all our sample projects.
Each sample demonstrates a special aspect of how to use Citrus. Most of the samples use a simple todo-list application as system under test. Please find following list of samples and their primary objective
| Configuration | Description | Sources |
|---|---|---|
| sample-reporting | Add custom test reporting | |
| sample-annotation-config | Use Java annotation configuration | |
| sample-javaconfig | Uses pure Java POJOs for configuration |
| Connectors | Description | Sources |
|---|---|---|
| sample-kubernetes | Run tests in Kubernetes | |
| sample-docker | Shows how to use Citrus within Docker |
| Demo | Description | Sources |
|---|---|---|
| sample-quarkus | How to verify Quarkus applications with Citrus | |
| sample-jbang | Prototype Citrus tests in minutes with JBang | |
| sample-cucumber | Shows BDD integration with Cucumber | |
| sample-camel-context | Interact with Apache Camel | |
| sample-selenium | Use Selenium for UI testing |
| Endpoints | Description | Sources |
|---|---|---|
| sample-https | Shows how to use SSL connectivity as a client and server | |
| sample-sftp | SFTP client and server interaction in Citrus | |
| sample-soap-mtom | Handle MTOM enabled SOAP attachments | |
| sample-scp | SCP client and server interaction in Citrus | |
| sample-dynamic-endpoints | Shows dynamic endpoint component usage | |
| sample-http | Shows REST API calls as a client | |
| sample-http-basic-auth | Basic authentication on client and server components | |
| sample-ftp | FTP client and server interaction in Citrus | |
| sample-soap-attachment | How to send SOAP attachments to server | |
| sample-soap-wssecurity | Configure SOAP web service client and server with WSSecurity | |
| sample-swagger | Auto generate tests from Open API | |
| sample-jdbc | Validates stored data in relational database | |
| sample-jms | Shows JMS message broker connectivity | |
| sample-http-loadtest | Calls REST API on Http server with multiple threads for load testing | |
| sample-http-static-response | Shows how to setup a static response generating Http server component | |
| sample-wsdl | Auto generate tests from WSDL | |
| sample-mail | Shows mail server activities in Citrus | |
| sample-kafka | Shows Kafka integration | |
| sample-soap-ssl | Shows SOAP secure web service support | |
| sample-rmi | Shows Remote Method Invocation support | |
| sample-soap-wsaddressing | Configure SOAP web service client and server with WSSecurity | |
| sample-soap-static-response | Shows how to setup a static response generating SOAP web service server component | |
| sample-soap | Shows SOAP web service support |
| Miscellaneous | Description | Sources |
|---|---|---|
| sample-dictionaries | Add data dictionaries | |
| sample-message-store | Use the local message store | |
| sample-gradle | Uses Gradle build to execute tests | |
| sample-behavior | Add custom test behavior |
| Quarkus | Description | Sources |
|---|---|---|
| camel-kafka | Testing Apache Camel Kafka routes in Quarkus with Citrus and Testcontainers | |
| event-driven-jms | How Citrus helps to verify event driven JMS messaging in a Quarkus application | |
| event-driven-kafka | How Citrus helps to verify event driven Kafka messaging in a Quarkus application |
| Runtimes | Description | Sources |
|---|---|---|
| sample-dataprovider | Shows TestNG data provider usage in Citrus | |
| sample-testng | Use TestNG test framework | |
| sample-junit5 | Use JUnit5 test framework | |
| sample-junit | Use JUnit test framework |
| Validation | Description | Sources |
|---|---|---|
| sample-xml | Shows XML validation feature with schema and Xpath validation | |
| sample-hamcrest | Use Hamcrest matchers | |
| sample-http-form-data | Exchange form data via Http GET/POST | |
| sample-sql | Execute SQL statements in Citrus | |
| sample-json | Shows Json payload validation feature with JsonPath validation | |
| sample-databind | Shows JSON object mapping feature when sending and receiving messages | |
| sample-xhtml | Shows XHTML validation feature | |
| sample-oxm | Shows XML object marshalling feature when sending and receiving messages | |
| sample-binary | Shows binary message content handling in Citrus |
Pick your sample application for try out and got to the respective folder. Each sample is executable on your host. You just need Maven, Java and a git client. Refer to the detailed instructions in the sample README.
Of course, we appreciate any kind of help that you can give us in order to make things easy for Citrus users. So if you have a sample worth reading for others please let us know. Also, if you are missing a sample because you do not know how to accomplish the Citrus use case please do not hesitate to contact us. You may also open a new issue in the Citrus samples repository.