As a measure agreed on in the Backend Senate November meeting we want to introduce the usage of a mockable proxy in the context of our integration tests.
This proxy should sit in front any adjacent system included in the integration tests (elastic & cambpm) and we want to use it to simulate failure response or even connectivity errors.
- a proxy is setup and configurable using a junit extension in the context of Integration tests
- tests are added for relevant scenarios:
- user role cleanup should not run if a user sync failed
- import should be resilient to failing fetch requests from the cambpm rest api
- import should be resilient to failing elasticsearch index bulks
- errors on copy/deleting a resource tree (collection, report) should not end up in a inconsistent state (e.g. it is acceptable that during a collection copy we fail on a report copy and an incomplete collection copy is created, so the user can just delete that copy themselves BUT it would not be acceptable if orphaned entities are left over, e.g. if reports would be copied first and the collection creation fails)
- once the proxy is set up add a test scenario that Optimize can cope Elasticsearch crashing on runtime