9 Testing
This chapter covers
- Introducing and using the Camel Test Kit
- Unit-testing Camel
- Testing with mocks
- Simulating components and errors
- Amending routes before testing
- Integration and system testing
- Using third-party test frameworks with Camel
Integrated systems are notoriously difficult to test. Systems being built and integrated today often involve a myriad of systems ranging from legacy systems, closed source commercial products, homegrown applications, and so on. These systems often have no built-in support for automated testing.
The poor folks who are tasked with testing such integrated systems often have no other choice than to play through manual use cases—triggering events from one window/terminal and then crossing their fingers and watching the results in the affected systems. And by watching, we mean looking at log files, checking databases, or any other manual procedure to verify the results. When they move on to the next use case, they have to reset the system to ensure its correct state before carrying on with the testing.
During development, the systems being integrated are often test systems that are from other teams or are available only in production. If the systems aren’t network connected, internal company procedures may hold back a speedy resolution. With the higher number of systems involved, it becomes more difficult for developers to build and test their work.