Skip to content

Commit d1c8045

Browse files
committed
Merge branch '1.12.x' into 1.13.x
2 parents 819fa61 + 5010e2d commit d1c8045

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void countedWithSuccessfulMetrics() {
6262

6363
Counter counter = meterRegistry.get("metric.success")
6464
.tag("method", "succeedWithMetrics")
65-
.tag("class", getClass().getName() + "$CountedService")
65+
.tag("class", CountedService.class.getName())
6666
.tag("extra", "tag")
6767
.tag("result", "success")
6868
.counter();
@@ -91,7 +91,7 @@ void countedWithFailure() {
9191

9292
Counter counter = meterRegistry.get("metric.failing")
9393
.tag("method", "fail")
94-
.tag("class", getClass().getName() + "$CountedService")
94+
.tag("class", CountedService.class.getName())
9595
.tag("exception", "RuntimeException")
9696
.tag("result", "failure")
9797
.counter();
@@ -131,7 +131,7 @@ void countedWithSuccessfulMetricsWhenCompleted() {
131131

132132
assertThat(meterRegistry.find("metric.success")
133133
.tag("method", "succeedWithMetrics")
134-
.tag("class", getClass().getName() + "$AsyncCountedService")
134+
.tag("class", AsyncCountedService.class.getName())
135135
.tag("extra", "tag")
136136
.tag("exception", "none")
137137
.tag("result", "success")
@@ -142,7 +142,7 @@ void countedWithSuccessfulMetricsWhenCompleted() {
142142

143143
Counter counterAfterCompletion = meterRegistry.get("metric.success")
144144
.tag("method", "succeedWithMetrics")
145-
.tag("class", getClass().getName() + "$AsyncCountedService")
145+
.tag("class", AsyncCountedService.class.getName())
146146
.tag("extra", "tag")
147147
.tag("exception", "none")
148148
.tag("result", "success")
@@ -159,7 +159,7 @@ void countedWithFailureWhenCompleted() {
159159

160160
assertThat(meterRegistry.find("metric.failing")
161161
.tag("method", "fail")
162-
.tag("class", getClass().getName() + "$AsyncCountedService")
162+
.tag("class", AsyncCountedService.class.getName())
163163
.tag("exception", "RuntimeException")
164164
.tag("result", "failure")
165165
.counter()).isNull();
@@ -169,7 +169,7 @@ void countedWithFailureWhenCompleted() {
169169

170170
Counter counter = meterRegistry.get("metric.failing")
171171
.tag("method", "fail")
172-
.tag("class", getClass().getName() + "$AsyncCountedService")
172+
.tag("class", AsyncCountedService.class.getName())
173173
.tag("exception", "RuntimeException")
174174
.tag("result", "failure")
175175
.counter();
@@ -220,7 +220,7 @@ void countedWithSuccessfulMetricsWhenReturnsCompletionStageNull() {
220220

221221
assertThat(meterRegistry.get("metric.success")
222222
.tag("method", "successButNull")
223-
.tag("class", getClass().getName() + "$AsyncCountedService")
223+
.tag("class", AsyncCountedService.class.getName())
224224
.tag("extra", "tag")
225225
.tag("exception", "none")
226226
.tag("result", "success")

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void timeMethod() {
5656
service.call();
5757

5858
assertThat(registry.get("call")
59-
.tag("class", getClass().getName() + "$TimedService")
59+
.tag("class", TimedService.class.getName())
6060
.tag("method", "call")
6161
.tag("extra", "tag")
6262
.timer()
@@ -89,7 +89,7 @@ void timeMethodWithLongTaskTimer() {
8989
service.longCall();
9090

9191
assertThat(registry.get("longCall")
92-
.tag("class", getClass().getName() + "$TimedService")
92+
.tag("class", TimedService.class.getName())
9393
.tag("method", "longCall")
9494
.tag("extra", "tag")
9595
.longTaskTimers()).hasSize(1);
@@ -137,7 +137,7 @@ void timeMethodWithError() {
137137
assertThatThrownBy(service::callRaisingError).isInstanceOf(TestError.class);
138138

139139
assertThat(registry.get("callRaisingError")
140-
.tag("class", getClass().getName() + "$TimedService")
140+
.tag("class", TimedService.class.getName())
141141
.tag("method", "callRaisingError")
142142
.tag("extra", "tag")
143143
.tag("exception", "TestError")
@@ -159,7 +159,7 @@ void timeMethodWithErrorAndLongTaskTimer() {
159159
assertThatThrownBy(service::longCallRaisingError).isInstanceOf(TestError.class);
160160

161161
assertThat(registry.get("longCallRaisingError")
162-
.tag("class", getClass().getName() + "$TimedService")
162+
.tag("class", TimedService.class.getName())
163163
.tag("method", "longCallRaisingError")
164164
.tag("extra", "tag")
165165
.longTaskTimer()
@@ -184,7 +184,7 @@ void timeMethodWhenCompleted() {
184184
completableFuture.join();
185185

186186
assertThat(registry.get("call")
187-
.tag("class", getClass().getName() + "$AsyncTimedService")
187+
.tag("class", AsyncTimedService.class.getName())
188188
.tag("method", "call")
189189
.tag("extra", "tag")
190190
.tag("exception", "none")
@@ -210,7 +210,7 @@ void timeMethodWhenCompletedExceptionally() {
210210
assertThatThrownBy(completableFuture::join).isInstanceOf(CompletionException.class);
211211

212212
assertThat(registry.get("call")
213-
.tag("class", getClass().getName() + "$AsyncTimedService")
213+
.tag("class", AsyncTimedService.class.getName())
214214
.tag("method", "call")
215215
.tag("extra", "tag")
216216
.tag("exception", "IllegalStateException")
@@ -233,7 +233,7 @@ void timeMethodWhenReturnCompletionStageNull() {
233233
assertThat(registry.getMeters()).isNotEmpty();
234234

235235
assertThat(registry.get("callNull")
236-
.tag("class", getClass().getName() + "$AsyncTimedService")
236+
.tag("class", AsyncTimedService.class.getName())
237237
.tag("method", "callNull")
238238
.tag("extra", "tag")
239239
.tag("exception", "none")
@@ -254,7 +254,7 @@ void timeMethodWithLongTaskTimerWhenCompleted() {
254254
CompletableFuture<?> completableFuture = service.longCall(guardedResult);
255255

256256
assertThat(registry.find("longCall")
257-
.tag("class", getClass().getName() + "$AsyncTimedService")
257+
.tag("class", AsyncTimedService.class.getName())
258258
.tag("method", "longCall")
259259
.tag("extra", "tag")
260260
.longTaskTimer()
@@ -264,7 +264,7 @@ void timeMethodWithLongTaskTimerWhenCompleted() {
264264
completableFuture.join();
265265

266266
assertThat(registry.get("longCall")
267-
.tag("class", getClass().getName() + "$AsyncTimedService")
267+
.tag("class", AsyncTimedService.class.getName())
268268
.tag("method", "longCall")
269269
.tag("extra", "tag")
270270
.longTaskTimer()
@@ -284,7 +284,7 @@ void timeMethodWithLongTaskTimerWhenCompletedExceptionally() {
284284
CompletableFuture<?> completableFuture = service.longCall(guardedResult);
285285

286286
assertThat(registry.find("longCall")
287-
.tag("class", getClass().getName() + "$AsyncTimedService")
287+
.tag("class", AsyncTimedService.class.getName())
288288
.tag("method", "longCall")
289289
.tag("extra", "tag")
290290
.longTaskTimer()
@@ -294,7 +294,7 @@ void timeMethodWithLongTaskTimerWhenCompletedExceptionally() {
294294
assertThatThrownBy(completableFuture::join).isInstanceOf(CompletionException.class);
295295

296296
assertThat(registry.get("longCall")
297-
.tag("class", getClass().getName() + "$AsyncTimedService")
297+
.tag("class", AsyncTimedService.class.getName())
298298
.tag("method", "longCall")
299299
.tag("extra", "tag")
300300
.longTaskTimer()
@@ -314,13 +314,13 @@ void timeMethodWithLongTaskTimerWhenReturnCompletionStageNull() {
314314
assertThat(completableFuture).isNull();
315315

316316
assertThat(registry.get("longCallNull")
317-
.tag("class", getClass().getName() + "$AsyncTimedService")
317+
.tag("class", AsyncTimedService.class.getName())
318318
.tag("method", "longCallNull")
319319
.tag("extra", "tag")
320320
.longTaskTimers()).hasSize(1);
321321

322322
assertThat(registry.find("longCallNull")
323-
.tag("class", getClass().getName() + "$AsyncTimedService")
323+
.tag("class", AsyncTimedService.class.getName())
324324
.tag("method", "longCallNull")
325325
.tag("extra", "tag")
326326
.longTaskTimer()

0 commit comments

Comments
 (0)