From f58d4bc6e8ba9c4940ea0e5d7b002c604adebeb6 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 10 Dec 2024 07:19:16 +0900 Subject: [PATCH] Polish gh-5605 (#5738) --- .../docs/observation/ObservationTestingTests.java | 2 +- .../micrometer/observation/tck/TestObservationRegistry.java | 2 +- .../observation/tck/TestObservationRegistryAssert.java | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/src/test/java/io/micrometer/docs/observation/ObservationTestingTests.java b/docs/src/test/java/io/micrometer/docs/observation/ObservationTestingTests.java index 1b2d76b18e..543cf94f2e 100644 --- a/docs/src/test/java/io/micrometer/docs/observation/ObservationTestingTests.java +++ b/docs/src/test/java/io/micrometer/docs/observation/ObservationTestingTests.java @@ -88,7 +88,7 @@ static class Example { } void run() { - final Observation observation = Observation.createNotStarted("foo", registry) + Observation observation = Observation.createNotStarted("foo", registry) .lowCardinalityKeyValue("lowTag", "lowTagValue") .highCardinalityKeyValue("highTag", "highTagValue"); observation.observe(() -> { diff --git a/micrometer-observation-test/src/main/java/io/micrometer/observation/tck/TestObservationRegistry.java b/micrometer-observation-test/src/main/java/io/micrometer/observation/tck/TestObservationRegistry.java index 456d7bd2dc..48bb0a42ef 100644 --- a/micrometer-observation-test/src/main/java/io/micrometer/observation/tck/TestObservationRegistry.java +++ b/micrometer-observation-test/src/main/java/io/micrometer/observation/tck/TestObservationRegistry.java @@ -121,7 +121,7 @@ public boolean supportsContext(Observation.Context context) { } @Override - public void onEvent(final Observation.Event event, final Observation.Context context) { + public void onEvent(Observation.Event event, Observation.Context context) { this.contexts.stream() .filter(testContext -> testContext.getContext() == context) .findFirst() diff --git a/micrometer-observation-test/src/main/java/io/micrometer/observation/tck/TestObservationRegistryAssert.java b/micrometer-observation-test/src/main/java/io/micrometer/observation/tck/TestObservationRegistryAssert.java index 481e248799..1844556cef 100644 --- a/micrometer-observation-test/src/main/java/io/micrometer/observation/tck/TestObservationRegistryAssert.java +++ b/micrometer-observation-test/src/main/java/io/micrometer/observation/tck/TestObservationRegistryAssert.java @@ -581,6 +581,7 @@ public TestObservationRegistryAssert backToTestObservationRegistry() { * @return this * @throws AssertionError if the {@link Observation} does not have an event with * the given name + * @since 1.15.0 */ public TestObservationRegistryAssertReturningObservationContextAssert hasEvent(String name) { isNotNull(); @@ -598,6 +599,7 @@ public TestObservationRegistryAssertReturningObservationContextAssert hasEvent(S * @return this * @throws AssertionError if the {@link Observation} does not have an event with * the given name and contextual name + * @since 1.15.0 */ public TestObservationRegistryAssertReturningObservationContextAssert hasEvent(String name, String contextualName) { @@ -616,6 +618,7 @@ public TestObservationRegistryAssertReturningObservationContextAssert hasEvent(S * @return this * @throws AssertionError if the {@link Observation} has an event with the given * name + * @since 1.15.0 */ public TestObservationRegistryAssertReturningObservationContextAssert doesNotHaveEvent(String name) { isNotNull(); @@ -629,10 +632,11 @@ public TestObservationRegistryAssertReturningObservationContextAssert doesNotHav * Verifies that the {@link Observation} does not have an event with the given * name and contextual name. * @param name event name - * @param contextualName contextual name@ + * @param contextualName contextual name * @return this * @throws AssertionError if the {@link Observation} has an event with the given * name and contextual name + * @since 1.15.0 */ public TestObservationRegistryAssertReturningObservationContextAssert doesNotHaveEvent(String name, String contextualName) {