In this post, I would like to consider how to write automated tests for negative scenarios for a system built using an asynchronous / event driven architecture. In my previous post, i have mentioned, that these systems are peculiar because the effect of the “write” actions are not immediately stored in the persistence layer of the application under test.
As an example, in the current system which i have been testing on the write side of the application, the write commands traverses though the Command API layer, the command controller layer and the command Handler layer before it ends up in the Event Store.
In recent months i have been testing a system built using the CQRS pattern. CQRS stands for Command Query Responsibility Segregation and you can read more about it here.As a tester, one of the key takeaway for me is that there is a Read side and a Write side to the application. This is very different to the other applications that i have tested in the past where a write operation would NOT be successfully until the data being sent to the application is successfully persisted.