Skip to content

Commit fcb0758

Browse files
authored
Add missing tests to Dynatrace types (#3626)
1 parent 67a409a commit fcb0758

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

implementations/micrometer-registry-dynatrace/src/test/java/io/micrometer/dynatrace/types/DynatraceDistributionSummaryTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ void testDynatraceDistributionSummaryValuesAreRecorded() {
6666
assertMinMaxSumCount(ds, 3.14, 4.76, 7.9, 2);
6767
}
6868

69+
@Test
70+
void testDynatraceDistributionSummary_NegativeValuesAreIgnored() {
71+
DynatraceDistributionSummary ds = new DynatraceDistributionSummary(ID, CLOCK, DISTRIBUTION_STATISTIC_CONFIG, 1);
72+
ds.record(-1.23);
73+
ds.record(-100.3);
74+
75+
assertMinMaxSumCount(ds, 0., 0., 0., 0);
76+
}
77+
78+
@Test
79+
void testDynatraceDistributionSummary_NaNValuesAreIgnored() {
80+
DynatraceDistributionSummary ds = new DynatraceDistributionSummary(ID, CLOCK, DISTRIBUTION_STATISTIC_CONFIG, 1);
81+
82+
ds.record(Double.NaN);
83+
84+
assertMinMaxSumCount(ds, 0., 0., 0., 0);
85+
}
86+
6987
@Test
7088
void testDynatraceDistributionSummaryScaled() {
7189
double scale = 1.5;

0 commit comments

Comments
 (0)