We are starting design of a system in Java that will have to integrate with a number of existing external systems. To support testing in a DEV environment where those external systems do not exist, I was wondering if Camel would provide a config-based approach to support mocking those external systems, recording the data in each request and returning the expected response. For example, each test scenario has a defined sequence of the expected interaction with each external system:
where VAL_X are the individual fields of each request/response. From a testing standpoint, I was looking for a config-based approach in my DEV environment to specify that instead of actually calling REQUEST_A1 on SYS_A, I instead append the data in that request to a file and unmarshal the values from another file to create the response object. With this approach, I would be able to build up a set of test scenarios with expected results and automate my test suite. Note that I'm not talking about writing a unit test to test my interface - I want to deploy my application in the DEV environment (with an alternate configuration) that allows me to then interact with my application, and this alternate configuration records the request data to a file and unmarshals the previously-created expected results from a file to confirm that my deployed application operates properly. I know I could write alternate implementations of each of those external systems that provide this functionality, but I was hoping that there would be a way to leverage the built-in capabilities of Camel to allow this approach generically. Does anyone have suggestions or a recommendation of another approach?
Thanks in advance
Aucun commentaire:
Enregistrer un commentaire