Skip to content

Conversation

simonbasle
Copy link
Contributor

This change adds assertions allowing to validate the usage of
Observation#error(Throwable):

  • doesNotHaveError()
  • hasError() (for any error)
  • hasError(Throwable) (for a specific error)

This change adds assertions allowing to validate the usage of
Observation#error(Throwable):
 - `doesNotHaveError()`
 - `hasError()` (for any error)
 - `hasError(Throwable)` (for a specific error)
@simonbasle
Copy link
Contributor Author

simonbasle commented Jul 5, 2022

possible further improvements to consider:

hasErrorWithMessage(String);
hasErrorSatisfying(ThrowingConsumer<Throwable>);
hasErrorMatching(Predicate<Throwable>);

Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks

@marcingrzejszczak marcingrzejszczak added the enhancement A general enhancement label Jul 6, 2022
@marcingrzejszczak marcingrzejszczak added this to the 1.10.0-M3 milestone Jul 6, 2022
@marcingrzejszczak marcingrzejszczak merged commit 21d450b into micrometer-metrics:main Jul 6, 2022
@marcingrzejszczak
Copy link
Contributor

The existing testing logic already supports the advanced cases. I'm renaming the methods for consistency - #3269

@simonbasle simonbasle deleted the addBasicErrorAssertions branch July 6, 2022 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants