@@ -50,7 +50,7 @@ void timeMethod() {
50
50
51
51
service .call ();
52
52
53
- assertThat (registry .get ("call" ).tag ("class" , this . getClass ().getName () + "$TimedService" ).tag ("method" , "call" )
53
+ assertThat (registry .get ("call" ).tag ("class" , getClass ().getName () + "$TimedService" ).tag ("method" , "call" )
54
54
.tag ("extra" , "tag" ).timer ().count ()).isEqualTo (1 );
55
55
}
56
56
@@ -79,7 +79,7 @@ void timeMethodWithLongTaskTimer() {
79
79
80
80
service .longCall ();
81
81
82
- assertThat (registry .get ("longCall" ).tag ("class" , this . getClass ().getName () + "$TimedService" )
82
+ assertThat (registry .get ("longCall" ).tag ("class" , getClass ().getName () + "$TimedService" )
83
83
.tag ("method" , "longCall" ).tag ("extra" , "tag" ).longTaskTimers ().size ()).isEqualTo (1 );
84
84
}
85
85
@@ -95,7 +95,7 @@ void timeMethodFailure() {
95
95
service .call ();
96
96
97
97
assertThatExceptionOfType (MeterNotFoundException .class ).isThrownBy (() -> {
98
- failingRegistry .get ("call" ).tag ("class" , this . getClass ().getName () + "$TimedService" ).tag ("method" , "call" )
98
+ failingRegistry .get ("call" ).tag ("class" , getClass ().getName () + "$TimedService" ).tag ("method" , "call" )
99
99
.tag ("extra" , "tag" ).timer ();
100
100
});
101
101
}
@@ -112,7 +112,7 @@ void timeMethodFailureWithLongTaskTimer() {
112
112
service .longCall ();
113
113
114
114
assertThatExceptionOfType (MeterNotFoundException .class ).isThrownBy (() -> {
115
- failingRegistry .get ("longCall" ).tag ("class" , this . getClass ().getName () + "$TimedService" )
115
+ failingRegistry .get ("longCall" ).tag ("class" , getClass ().getName () + "$TimedService" )
116
116
.tag ("method" , "longCall" ).tag ("extra" , "tag" ).longTaskTimer ();
117
117
});
118
118
}
@@ -129,14 +129,14 @@ void timeMethodWhenCompleted() {
129
129
GuardedResult guardedResult = new GuardedResult ();
130
130
CompletableFuture <?> completableFuture = service .call (guardedResult );
131
131
132
- assertThat (registry .find ("call" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
133
- .tag ("method" , "call" ). tag ( " extra" , "tag" ).tag ("exception" , "none" ).timer ()).isNull ();
132
+ assertThat (registry .find ("call" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" ). tag ( "method" , "call " )
133
+ .tag ("extra" , "tag" ).tag ("exception" , "none" ).timer ()).isNull ();
134
134
135
135
guardedResult .complete ();
136
136
completableFuture .join ();
137
137
138
- assertThat (registry .get ("call" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
139
- .tag ("method" , "call" ). tag ( " extra" , "tag" ).tag ("exception" , "none" ).timer ().count ()).isEqualTo (1 );
138
+ assertThat (registry .get ("call" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" ). tag ( "method" , "call " )
139
+ .tag ("extra" , "tag" ).tag ("exception" , "none" ).timer ().count ()).isEqualTo (1 );
140
140
}
141
141
142
142
@ Test
@@ -151,15 +151,14 @@ void timeMethodWhenCompletedExceptionally() {
151
151
GuardedResult guardedResult = new GuardedResult ();
152
152
CompletableFuture <?> completableFuture = service .call (guardedResult );
153
153
154
- assertThat (registry .find ("call" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
155
- .tag ("method" , "call" ). tag ( " extra" , "tag" ).tag ("exception" , "NullPointerException" ).timer ()).isNull ();
154
+ assertThat (registry .find ("call" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" ). tag ( "method" , "call " )
155
+ .tag ("extra" , "tag" ).tag ("exception" , "NullPointerException" ).timer ()).isNull ();
156
156
157
157
guardedResult .complete (new NullPointerException ());
158
158
catchThrowableOfType (completableFuture ::join , CompletionException .class );
159
159
160
- assertThat (registry .get ("call" ).tag ("class" , this .getClass ().getName () + "$AsyncTimedService" )
161
- .tag ("method" , "call" ).tag ("extra" , "tag" ).tag ("exception" , "NullPointerException" ).timer ().count ())
162
- .isEqualTo (1 );
160
+ assertThat (registry .get ("call" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" ).tag ("method" , "call" )
161
+ .tag ("extra" , "tag" ).tag ("exception" , "NullPointerException" ).timer ().count ()).isEqualTo (1 );
163
162
}
164
163
165
164
@ Test
@@ -174,13 +173,13 @@ void timeMethodWithLongTaskTimerWhenCompleted() {
174
173
GuardedResult guardedResult = new GuardedResult ();
175
174
CompletableFuture <?> completableFuture = service .longCall (guardedResult );
176
175
177
- assertThat (registry .find ("longCall" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
176
+ assertThat (registry .find ("longCall" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" )
178
177
.tag ("method" , "longCall" ).tag ("extra" , "tag" ).longTaskTimer ().activeTasks ()).isEqualTo (1 );
179
178
180
179
guardedResult .complete ();
181
180
completableFuture .join ();
182
181
183
- assertThat (registry .get ("longCall" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
182
+ assertThat (registry .get ("longCall" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" )
184
183
.tag ("method" , "longCall" ).tag ("extra" , "tag" ).longTaskTimer ().activeTasks ()).isEqualTo (0 );
185
184
}
186
185
@@ -196,13 +195,13 @@ void timeMethodWithLongTaskTimerWhenCompletedExceptionally() {
196
195
GuardedResult guardedResult = new GuardedResult ();
197
196
CompletableFuture <?> completableFuture = service .longCall (guardedResult );
198
197
199
- assertThat (registry .find ("longCall" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
198
+ assertThat (registry .find ("longCall" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" )
200
199
.tag ("method" , "longCall" ).tag ("extra" , "tag" ).longTaskTimer ().activeTasks ()).isEqualTo (1 );
201
200
202
201
guardedResult .complete (new NullPointerException ());
203
202
catchThrowableOfType (completableFuture ::join , CompletionException .class );
204
203
205
- assertThat (registry .get ("longCall" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
204
+ assertThat (registry .get ("longCall" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" )
206
205
.tag ("method" , "longCall" ).tag ("extra" , "tag" ).longTaskTimer ().activeTasks ()).isEqualTo (0 );
207
206
}
208
207
@@ -220,8 +219,8 @@ void timeMethodFailureWhenCompletedExceptionally() {
220
219
guardedResult .complete ();
221
220
completableFuture .join ();
222
221
223
- assertThatExceptionOfType (MeterNotFoundException .class ). isThrownBy (
224
- ( ) -> failingRegistry .get ("call" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
222
+ assertThatExceptionOfType (MeterNotFoundException .class )
223
+ . isThrownBy (( ) -> failingRegistry .get ("call" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" )
225
224
.tag ("method" , "call" ).tag ("extra" , "tag" ).tag ("exception" , "none" ).timer ());
226
225
}
227
226
@@ -240,7 +239,7 @@ void timeMethodFailureWithLongTaskTimerWhenCompleted() {
240
239
completableFuture .join ();
241
240
242
241
assertThatExceptionOfType (MeterNotFoundException .class ).isThrownBy (() -> {
243
- failingRegistry .get ("longCall" ).tag ("class" , this . getClass ().getName () + "$AsyncTimedService" )
242
+ failingRegistry .get ("longCall" ).tag ("class" , getClass ().getName () + "$AsyncTimedService" )
244
243
.tag ("method" , "longCall" ).tag ("extra" , "tag" ).longTaskTimer ();
245
244
});
246
245
}
0 commit comments