This commit introduces a comprehensive refactoring of the event-store module to guarantee data consistency and improve the quality and reliability of its test suite. Data Consistency Implemented Redis transactions (MULTI/EXEC) for the appendToStream operation in RedisEventStore. This ensures that writing an event to the aggregate-specific stream and the global "all-events" stream is an atomic operation, preventing data inconsistencies in case of partial failures. Improved error handling by invalidating the local stream version cache on transactional failures. Testing Enhancements Refactored Consumer Tests: Replaced the asynchronous, thread-based consumer test in RedisIntegrationTest with a synchronous, deterministic approach. The test now manually calls pollEvents() to verify event consumption, making it faster and 100% reliable by removing Thread.sleep and CountDownLatch. Simplified Test Events: Reduced boilerplate code in test event data classes (TestCreatedEvent, TestUpdatedEvent) in both RedisEventStoreTest and RedisIntegrationTest by using the @Transient annotation on overridden properties from BaseDomainEvent. Fixed Compilation Errors: Resolved various compilation errors in the test suite that arose from refactoring and incorrect mock definitions. |
||
|---|---|---|
| .. | ||
| auth | ||
| cache | ||
| event-store | ||
| gateway | ||
| messaging | ||
| monitoring | ||
| README-INFRASTRUCTURE.md | ||