Skip to content

Commit cc2ae4c

Browse files
committed
Fix Micrometer Test
1 parent ed3ca33 commit cc2ae4c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

spring-kafka/src/main/java/org/springframework/kafka/support/micrometer/MicrometerHolder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public Object start() {
9191
* @param sample the sample.
9292
* @see #start()
9393
*/
94+
@SuppressWarnings("deprecation")
9495
public void success(Object sample) {
9596
Timer timer = this.meters.get(NONE_EXCEPTION_METERS_KEY);
9697
if (timer != null) {
@@ -104,6 +105,7 @@ public void success(Object sample) {
104105
* @param exception the exception name.
105106
* @see #start()
106107
*/
108+
@SuppressWarnings("deprecation")
107109
public void failure(Object sample, String exception) {
108110
Timer timer = this.meters.get(exception);
109111
if (timer == null) {

spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/MicrometerHolderTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*/
4343
public class MicrometerHolderTests {
4444

45-
@SuppressWarnings({ "unchecked" })
45+
@SuppressWarnings({ "unchecked", "deprecation" })
4646
@Test
4747
public void testMicrometerHolderRecordSuccessWorksGracefullyAfterDestroy() {
4848
MeterRegistry meterRegistry = new SimpleMeterRegistry();
@@ -64,7 +64,7 @@ public void testMicrometerHolderRecordSuccessWorksGracefullyAfterDestroy() {
6464
micrometerHolder.success(sample);
6565

6666
verify(ctx, times(1)).getBeansOfType(any(), anyBoolean(), anyBoolean());
67-
verify(sample, times(1)).stop(any());
67+
verify(sample, times(1)).stop(any(Timer.class));
6868
verifyNoMoreInteractions(ctx, sample);
6969
}
7070

0 commit comments

Comments
 (0)