|
|
|
@ -17,6 +17,7 @@ |
|
|
|
package org.springframework.boot.actuate.autoconfigure.metrics.export.otlp; |
|
|
|
package org.springframework.boot.actuate.autoconfigure.metrics.export.otlp; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
|
|
import io.micrometer.registry.otlp.AggregationTemporality; |
|
|
|
import io.micrometer.registry.otlp.AggregationTemporality; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
@ -67,4 +68,17 @@ class OtlpPropertiesConfigAdapterTests { |
|
|
|
assertThat(new OtlpPropertiesConfigAdapter(properties).headers()).containsEntry("header", "value"); |
|
|
|
assertThat(new OtlpPropertiesConfigAdapter(properties).headers()).containsEntry("header", "value"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void whenPropertiesBaseTimeUnitIsNotSetAdapterBaseTimeUnitReturnsMillis() { |
|
|
|
|
|
|
|
OtlpProperties properties = new OtlpProperties(); |
|
|
|
|
|
|
|
assertThat(new OtlpPropertiesConfigAdapter(properties).baseTimeUnit()).isSameAs(TimeUnit.MILLISECONDS); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void whenPropertiesBaseTimeUnitIsSetAdapterBaseTimeUnitReturnsIt() { |
|
|
|
|
|
|
|
OtlpProperties properties = new OtlpProperties(); |
|
|
|
|
|
|
|
properties.setBaseTimeUnit(TimeUnit.SECONDS); |
|
|
|
|
|
|
|
assertThat(new OtlpPropertiesConfigAdapter(properties).baseTimeUnit()).isSameAs(TimeUnit.SECONDS); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|