Skip to content

Commit 9619aba

Browse files
committed
spring-projectsGH-2638: Fix Deprecation Warnings in Tests
1 parent 353ce9e commit 9619aba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ void testMicrometerHolderRecordSuccessWorksGracefullyAfterDestroy() {
5757
given(beanProvider.getIfUnique()).willReturn(meterRegistry);
5858

5959
MicrometerHolder micrometerHolder = new MicrometerHolder(ctx, "holderName",
60-
"timerName", "timerDesc", Collections.emptyMap());
60+
"timerName", "timerDesc", r -> Collections.emptyMap());
6161
Map<String, Timer> meters = (Map<String, Timer>) ReflectionTestUtils.getField(micrometerHolder, "meters");
6262
assertThat(meters).hasSize(1);
6363

@@ -77,23 +77,23 @@ void testMicrometerHolderRecordSuccessWorksGracefullyAfterDestroy() {
7777
@Test
7878
void multiReg() {
7979
assertThatIllegalStateException().isThrownBy(() -> new MicrometerHolder(
80-
new AnnotationConfigApplicationContext(Config1.class), "", "", "", Collections.emptyMap()))
80+
new AnnotationConfigApplicationContext(Config1.class), "", "", "", r -> Collections.emptyMap()))
8181
.withMessage("No micrometer registry present (or more than one and "
8282
+ "there is not exactly one marked with @Primary)");
8383
}
8484

8585
@Test
8686
void twoPrimaries() {
8787
assertThatIllegalStateException().isThrownBy(() -> new MicrometerHolder(
88-
new AnnotationConfigApplicationContext(Config2.class), "", "", "", Collections.emptyMap()))
88+
new AnnotationConfigApplicationContext(Config2.class), "", "", "", r -> Collections.emptyMap()))
8989
.withMessageContaining("more than one 'primary' bean");
9090
}
9191

9292
@Test
9393
void primary() {
9494
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config3.class);
9595
MicrometerHolder micrometerHolder = new MicrometerHolder(ctx, "holderName",
96-
"timerName", "timerDesc", Collections.emptyMap());
96+
"timerName", "timerDesc", r -> Collections.emptyMap());
9797
@SuppressWarnings("unchecked")
9898
Map<String, Timer> meters = (Map<String, Timer>) ReflectionTestUtils.getField(micrometerHolder, "meters");
9999
assertThat(meters).hasSize(1);

0 commit comments

Comments
 (0)