Hi Dzianis,
Apologies for a late reply. The reason for not using
getMismatchDescription() in timeout messages as defualt was that it
sometimes resulted in confusing messages like:
"Condition with alias 'test' didn't complete within 120 milliseconds
because com.jayway.awaitility.classes.FakeRepositoryImpl.getValue()
expected a value greater than <0> but <0> was equal to <0>."
Another way would be to generate more descriptive messages yourself.
ConditionEvaluationListener provides instance of EvaluatedCondition,
that gives you access to the currentConditionValue, matcher and
matcher's methods like mismatchDescription() and description().
Unfortunately, it doesn't give you a way to override final timeout
message, only intermediary ones.
Hmm, a longrn soltion would be to collect a small but representative
sample of different matchers and find some win-win solution for
timeout messages for all of them. If you could provide a sample of
such tests in pull request, that would be a good starting point to
improve the situation,
Regards,
Maciej