Skip to content

Commit

Permalink
Improve assertions in TimedAspectTest
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatan-ivanov committed Sep 19, 2024
1 parent 9b12e82 commit 9d11458
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.micrometer.core.instrument.Timer;
import io.micrometer.core.instrument.distribution.DistributionStatisticConfig;
import io.micrometer.core.instrument.distribution.pause.PauseDetector;
import io.micrometer.core.instrument.search.MeterNotFoundException;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.jupiter.api.Nested;
Expand All @@ -40,7 +39,8 @@
import java.util.function.Predicate;

import static java.util.concurrent.CompletableFuture.supplyAsync;
import static org.assertj.core.api.Assertions.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

class TimedAspectTest {

Expand Down Expand Up @@ -389,7 +389,7 @@ void ignoreClassLevelAnnotationIfMethodLevelPresent() {

service.annotatedOnMethod();

assertThatExceptionOfType(MeterNotFoundException.class).isThrownBy(() -> registry.get("call").timer());
assertThat(registry.getMeters()).hasSize(1);
assertThat(registry.get("annotatedOnMethod")
.tag("class", "io.micrometer.core.aop.TimedAspectTest$TimedClass")
.tag("method", "annotatedOnMethod")
Expand Down

0 comments on commit 9d11458

Please sign in to comment.