Currently AsyncEventChannels is used to verify async behaviour in our test suite and this is not easy to maintain, especially because we are mixing test code with the main business logic, see as an example:
|
if (mediator.testMode()) |
|
mediator.publishEvent(AsyncEventChannels.DATASET_MISSING_VALUES, dataset.testid, event); |
|
mediator.missingValuesDataset(event); |
|
} |
|
DataPoint.DatasetProcessedEvent event = new DataPoint.DatasetProcessedEvent(DatasetMapper.fromInfo(dataset.getInfo()), |
|
notify); |
|
if (mediator.testMode()) |
|
Util.registerTxSynchronization(tm, |
|
txStatus -> mediator.publishEvent(AsyncEventChannels.DATAPOINT_PROCESSED, dataset.testid, event)); |
We are pushing events to the bus just for testing purposes.
Proposal
As suggested here as well #2348 (comment) get rid of the AsyncEventChannels enum and adapt the test suite without that event bus approach to test async processes.
Currently
AsyncEventChannelsis used to verify async behaviour in our test suite and this is not easy to maintain, especially because we are mixing test code with the main business logic, see as an example:Horreum/horreum-backend/src/main/java/io/hyperfoil/tools/horreum/svc/AlertingServiceImpl.java
Lines 524 to 532 in b4de5a7
We are pushing events to the bus just for testing purposes.
Proposal
As suggested here as well #2348 (comment) get rid of the
AsyncEventChannelsenum and adapt the test suite without that event bus approach to test async processes.