Duration
3 days
OVERVIEW
Citrus is a test framework written in Java that enables automated integration testing of message-based EAI applications. The tool can easily simulate surrounding systems across various transports and protocols (e.g. JMS, SOAP Web Services, Http, TCP/IP) in order to perform end-to-end use case testing.
Citrus provides strong validation mechanisms for XML message contents and allows to build complex testing logic. Citrus supports you with features such as: Sending and receiving messages, Database validation, Automatic retries, Variable definitions, Message timeout simulation, Dynamic message contents, Error simulation, Iterations and many more.
Performing Integration or System Tests can be a hard task at times. There are some silver bullets to perform testing REST-based environments, such as RestAssured, Karate Framework or even TestNG with Apache HTTP Client. For SOAP the options are usually rather limited, so I decided to investigate even further. I stumbled upon Citrus Framework as it seemed to provide a fair support to SOAP messages. Since it supports REST as well, it seemed to be a very nice fit for this particular case where I had to perform System-wide tests on both interfaces at the same time.
BENEFITS
- Cost savings thanks to the use of an existing framework
- Reliably helps you achieve your quality, function and stability goals
- Stock-taking can be realized accurately at any time during the development process
- Trouble-free migration from development to production
- Low cost solution thanks to open source technology
- Review of messages exchanged between the system needing to be tested and all components that are to be connected
Module 1 - Introduction to Citrus Framework & Integration Testing
Citrus offers a wide range of test actions to take control of the process flow during a test. The basic goal in Citrus test cases is to describe a whole use case scenario including several interface partners that exchange many messages with each other. The composition of complex message flows in a single test case with several test steps is one of the major features in Citrus.
- What is Citrus Framework?
- Adaption and Appreciation of Citrus Framework
- Overview of Integration Testing
- Types of Integration Testing Application to Citrus Framework
- Testing Setup in Citrus
- Test Cases for Citrus Framework
- Test Variables
- Iterations
- system availability checks
- database connectivity
- parallelism
- delaying
- error simulation
- scripting
- Run & Configuration
- Endpoints
Module 2 – Actions, Message & Validation in Citrus Integrated Testing
Citrus provides powerful message validation capabilities. Each incoming message is validated with syntax and semantics. The tester is able to define expected message headers and payloads. Citrus message validator implementations will compare the messages and report differences as test failure.
- Validation & Validator Implementation
- - Schema
- - Json
- - Xhtml
- - Plaintext
- - Binary
- - Gzip
- Actions
- - Send, Receive, Database
- - Sleep, Java, Timeout, Stop-time
Module 3 – Creating Test Variables in Citrus Framework
The usage of test variables is a core concept when writing good maintainable tests. The key identifiers of a test case should be exposed as test variables at the very beginning of a test. This way hard coded identifiers and multiple redundant values inside the test can be avoided from scratch. As a tester you define all test variables at the very beginning of your test.
- Trace
- Transform
- Groovy
- Fail
- Input
- Load
- Wait
- Purge (jms, channels, endpoints)
- Assert
- Catch
- Manage-Server
- Generic-action
- Stop-timer
Module 4 –Templates & Containers in Citrus Framework
Similar to templates a container element holds one to many test actions. In contrast to the template the container appears directly inside the test case action chain, meaning that the container is not referenced by more than one test case.
- Sequential
- Conditional
- Parallel
- Iterate
- Repeat
- Repeat-on error
Module 5 – Functions & Prefixes in Citrus Framework
The test framework will offer several functions that are useful throughout the test execution. The functions will always return a string value that is ready for use as variable value or directly inside a text message. A set of functions is usually combined to a function library. The library has a prefix that will identify the functions inside the test case.
- Validation Matchers
- Data-dictionary
- Test-actors
- Test-suite
- Meta-info
- Message-tracing
- Reporting
Module 6 – Testing and Cases Finally Section in Citrus Framework
A special section inside the test case that is executed even in case errors did occur during the test. We might run into some problems when the test failed. We face the problem that the whole test case will terminate immediately in case of errors. Cleanup tasks at the end of the test action chain may not be executed correctly.
- Http, Http-websocket
- Soap, Ftp
- Message-channel, File
- Camel, Vertx, Mail
- Arquilian
- Docker
- Cucumber
- Zookeeper
Note
Activities on high team interaction and role-plays will be incorporated during training session with all participants to further facilitate and strengthen candidates understanding on Citrus Integration Testing concepts and methodology in an overall manner.
Programme scope, delivery arrangements and suitability are confirmed during enquiry.