Skip to content

Commit 9adf526

Browse files
Merge branch '1.9.x' into 1.12.x
2 parents dca4904 + f530d87 commit 9adf526

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

micrometer-core/src/test/java/io/micrometer/core/aop/TimedAspectTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ void timeMethodWhenCompletedExceptionally() {
206206
assertThat(registry.getMeters()).isEmpty();
207207

208208
guardedResult.complete(new IllegalStateException("simulated"));
209-
catchThrowableOfType(completableFuture::join, CompletionException.class);
209+
assertThatThrownBy(completableFuture::join).isInstanceOf(CompletionException.class);
210210

211211
assertThat(registry.get("call")
212212
.tag("class", getClass().getName() + "$AsyncTimedService")
@@ -266,8 +266,8 @@ void timeMethodWithLongTaskTimerWhenCompletedExceptionally() {
266266
.longTaskTimer()
267267
.activeTasks()).isEqualTo(1);
268268

269-
guardedResult.complete(new NullPointerException());
270-
catchThrowableOfType(completableFuture::join, CompletionException.class);
269+
guardedResult.complete(new IllegalStateException("simulated"));
270+
assertThatThrownBy(completableFuture::join).isInstanceOf(CompletionException.class);
271271

272272
assertThat(registry.get("longCall")
273273
.tag("class", getClass().getName() + "$AsyncTimedService")
@@ -341,7 +341,7 @@ void timeClassWithSkipPredicate() {
341341

342342
service.call();
343343

344-
assertThat(registry.find("call").timer()).isNull();
344+
assertThat(registry.getMeters()).isEmpty();
345345
}
346346

347347
@Test

0 commit comments

Comments
 (0)