From 956a579bc9b09045f99f668ea5c93229b2dd2717 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Wed, 22 Feb 2023 01:02:23 +0900 Subject: [PATCH] Polish "Add missing Micrometer PropertiesConfigAdapterTests" See gh-34319 --- .../graphite/GraphitePropertiesConfigAdapterTests.java | 4 ++-- .../newrelic/NewRelicPropertiesConfigAdapterTests.java | 2 +- ...Tests.java => SignalFxPropertiesConfigAdapterTests.java} | 2 +- .../export/simple/SimplePropertiesConfigAdapterTests.java | 6 ++---- 4 files changed, 6 insertions(+), 8 deletions(-) rename spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/{SignalFXPropertiesConfigAdapterTests.java => SignalFxPropertiesConfigAdapterTests.java} (98%) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphitePropertiesConfigAdapterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphitePropertiesConfigAdapterTests.java index 68e6bef9cf..ef2de2d69d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphitePropertiesConfigAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphitePropertiesConfigAdapterTests.java @@ -55,8 +55,8 @@ class GraphitePropertiesConfigAdapterTests { @Test void whenPropertiesDurationUnitsIsSetAdapterDurationUnitsReturnsIt() { GraphiteProperties properties = new GraphiteProperties(); - properties.setRateUnits(TimeUnit.MINUTES); - assertThat(new GraphitePropertiesConfigAdapter(properties).rateUnits()).isEqualTo(TimeUnit.MINUTES); + properties.setDurationUnits(TimeUnit.MINUTES); + assertThat(new GraphitePropertiesConfigAdapter(properties).durationUnits()).isEqualTo(TimeUnit.MINUTES); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicPropertiesConfigAdapterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicPropertiesConfigAdapterTests.java index 5ef2fd99e7..f3e3e80df5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicPropertiesConfigAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicPropertiesConfigAdapterTests.java @@ -63,7 +63,7 @@ class NewRelicPropertiesConfigAdapterTests } @Test - void whenPropertiesApikeyIsSetAdapterApikeyReturnsIt() { + void whenPropertiesApiKeyIsSetAdapterApiKeyReturnsIt() { NewRelicProperties properties = createProperties(); properties.setApiKey("my-key"); assertThat(createConfigAdapter(properties).apiKey()).isEqualTo("my-key"); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFXPropertiesConfigAdapterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxPropertiesConfigAdapterTests.java similarity index 98% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFXPropertiesConfigAdapterTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxPropertiesConfigAdapterTests.java index 03ed7435b5..a03af634c0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFXPropertiesConfigAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxPropertiesConfigAdapterTests.java @@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Mirko Sobeck */ -class SignalFXPropertiesConfigAdapterTests +class SignalFxPropertiesConfigAdapterTests extends StepRegistryPropertiesConfigAdapterTests { @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapterTests.java index c62ddaeebc..5b7ba9a650 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapterTests.java @@ -21,12 +21,10 @@ import java.time.Duration; import io.micrometer.core.instrument.simple.CountingMode; import org.junit.jupiter.api.Test; -import org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxPropertiesConfigAdapter; - import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link SignalFxPropertiesConfigAdapter}. + * Tests for {@link SimplePropertiesConfigAdapter}. * * @author Mirko Sobeck */ @@ -40,7 +38,7 @@ class SimplePropertiesConfigAdapterTests { } @Test - void whenPropertiesAccessTokenIsSetAdapterAccessTokenReturnsIt() { + void whenPropertiesModeIsSetAdapterModeReturnsIt() { SimpleProperties properties = new SimpleProperties(); properties.setMode(CountingMode.STEP); assertThat(new SimplePropertiesConfigAdapter(properties).mode()).isEqualTo(CountingMode.STEP);