Skip to content

Commit c1c90b1

Browse files
dreis2211snicoll
authored andcommitted
Fix some deprecations
See gh-21212
1 parent 2eef71c commit c1c90b1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 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.
@@ -240,39 +240,39 @@ void configureWhenHasMinimumExpectedValueShouldSetMinimumExpectedToValue() {
240240
PropertiesMeterFilter filter = new PropertiesMeterFilter(
241241
createProperties("distribution.minimum-expected-value.spring.boot=10"));
242242
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT)
243-
.getMinimumExpectedValue()).isEqualTo(Duration.ofMillis(10).toNanos());
243+
.getMinimumExpectedValueAsDouble()).isEqualTo(Duration.ofMillis(10).toNanos());
244244
}
245245

246246
@Test
247247
void configureWhenHasHigherMinimumExpectedValueShouldSetMinimumExpectedValueToValue() {
248248
PropertiesMeterFilter filter = new PropertiesMeterFilter(
249249
createProperties("distribution.minimum-expected-value.spring=10"));
250250
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT)
251-
.getMinimumExpectedValue()).isEqualTo(Duration.ofMillis(10).toNanos());
251+
.getMinimumExpectedValueAsDouble()).isEqualTo(Duration.ofMillis(10).toNanos());
252252
}
253253

254254
@Test
255255
void configureWhenHasHigherMinimumExpectedValueAndLowerShouldSetMinimumExpectedValueToHigher() {
256256
PropertiesMeterFilter filter = new PropertiesMeterFilter(createProperties(
257257
"distribution.minimum-expected-value.spring=10", "distribution.minimum-expected-value.spring.boot=50"));
258258
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT)
259-
.getMinimumExpectedValue()).isEqualTo(Duration.ofMillis(50).toNanos());
259+
.getMinimumExpectedValueAsDouble()).isEqualTo(Duration.ofMillis(50).toNanos());
260260
}
261261

262262
@Test
263263
void configureWhenHasMaximumExpectedValueShouldSetMaximumExpectedToValue() {
264264
PropertiesMeterFilter filter = new PropertiesMeterFilter(
265265
createProperties("distribution.maximum-expected-value.spring.boot=5000"));
266266
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT)
267-
.getMaximumExpectedValue()).isEqualTo(Duration.ofMillis(5000).toNanos());
267+
.getMaximumExpectedValueAsDouble()).isEqualTo(Duration.ofMillis(5000).toNanos());
268268
}
269269

270270
@Test
271271
void configureWhenHasHigherMaximumExpectedValueShouldSetMaximumExpectedValueToValue() {
272272
PropertiesMeterFilter filter = new PropertiesMeterFilter(
273273
createProperties("distribution.maximum-expected-value.spring=5000"));
274274
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT)
275-
.getMaximumExpectedValue()).isEqualTo(Duration.ofMillis(5000).toNanos());
275+
.getMaximumExpectedValueAsDouble()).isEqualTo(Duration.ofMillis(5000).toNanos());
276276
}
277277

278278
@Test
@@ -281,7 +281,7 @@ void configureWhenHasHigherMaximumExpectedValueAndLowerShouldSetMaximumExpectedV
281281
createProperties("distribution.maximum-expected-value.spring=5000",
282282
"distribution.maximum-expected-value.spring.boot=10000"));
283283
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT)
284-
.getMaximumExpectedValue()).isEqualTo(Duration.ofMillis(10000).toNanos());
284+
.getMaximumExpectedValueAsDouble()).isEqualTo(Duration.ofMillis(10000).toNanos());
285285
}
286286

287287
private Id createMeterId(String name) {

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void adminProperties() {
214214
"spring.kafka.admin.ssl.trust-store-type=PKCS12", "spring.kafka.admin.ssl.protocol=TLSv1.2")
215215
.run((context) -> {
216216
KafkaAdmin admin = context.getBean(KafkaAdmin.class);
217-
Map<String, Object> configs = admin.getConfig();
217+
Map<String, Object> configs = admin.getConfigurationProperties();
218218
// common
219219
assertThat(configs.get(AdminClientConfig.CLIENT_ID_CONFIG)).isEqualTo("cid");
220220
// admin
@@ -583,7 +583,7 @@ void specificSecurityProtocolOverridesCommonSecurityProtocol() {
583583
Map<String, Object> producerConfigs = producerFactory.getConfigurationProperties();
584584
assertThat(producerConfigs.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)).isEqualTo("SSL");
585585
KafkaAdmin admin = context.getBean(KafkaAdmin.class);
586-
Map<String, Object> configs = admin.getConfig();
586+
Map<String, Object> configs = admin.getConfigurationProperties();
587587
assertThat(configs.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)).isEqualTo("PLAINTEXT");
588588
});
589589
}

0 commit comments

Comments
 (0)