I have tests and want to make assertions against micrometer metrics, but the tests run in random order so I want to reset or clear all the micrometer metrics before each test so my assertion are always correct.
It depends on the Meter registry used. If you are using a SimpleMeterRegistry
you could do:
registry.getMeters().forEach((meter) -> registry.remove(meter))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With