Support multiple AfterAssertionErrorCollected callbacks by Achitheus · Pull Request #3313 · assertj/assertj

Check List:

  • Fixes -> ignore
  • Unit tests : YES
  • Javadoc with a code example (on API only) : NA
  • PR meets the contributing guidelines

Let AssertJ integrations safely rely on this fuctionality!

Without this multiple callbacks support there is a problem with using DefaultAssertionErrorCollector.setAfterAssertionErrorCollected() method.
It can be used only by user at the moment, but not by another frameworks developers .
Why do I think so? Because callback field in the DefaultAssertionErrorCollector class is not instance of any Collection<AfterAssertionErrorCollected> type, but is just AfterAssertionErrorCollected. Thus setAfterAssertionErrorCollected() method can be executed only once for each SoftAssertions object (by exact single actor - user), because every next call leads to overriding and erasing previously set callback.