AxonFramework / AxonFramework

Framework for Evolutionary Message-Driven Microservices on the JVM
https://axoniq.io/
Apache License 2.0
3.32k stars 790 forks source link

[#3063] Fine tuning of `MessageStream` and introduction of `MessageStream#reduce` #3116

Closed smcvb closed 1 month ago

smcvb commented 1 month ago

This pull request does numerous things for the MessageStream interface and its implementations. A large part is "cleanup and finetuning," which includes variable/parameter/method/class renaming, JavaDoc additions and expansion, indentation changes, and method ordering adjustments.

Importantly, a bunch of tests have been included in the MessageStreamTest suite, as well as a couple of missing implementations of this test suite.

Lastly, the MessageStream#reduce(R identity, BiFunction<R, M, R> accumulator) method, with implementations and tests, has been introduced in this PR. This reduce operation is a logical necessity for the repositories, which will retrieve a MessageStream<EventMessage<?>> from the Event Store and are required to reduce this stream into a single model instance.

The MessageStream#reduce introduction makes the resolution of this PR a blocker for #3101.

By doing the above, and more (with the reduce introduction), this pull request resolves #3063.

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
77.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud