Skip to content

Commit a6e1dee

Browse files
committed
Fix failing test in MicrometerNodeMetricUpdaterTest
1 parent 9b42e38 commit a6e1dee

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

metrics/micrometer/src/test/java/com/datastax/oss/driver/internal/metrics/micrometer/MicrometerNodeMetricUpdaterTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ public void should_log_warning_when_provided_eviction_time_setting_is_too_low()
7979
when(profile.getDuration(DefaultDriverOption.METRICS_NODE_EXPIRE_AFTER))
8080
.thenReturn(expireAfter);
8181
when(generator.nodeMetricId(node, DefaultNodeMetric.CQL_MESSAGES)).thenReturn(METRIC_ID);
82+
when(profile.getDuration(DefaultDriverOption.METRICS_NODE_CQL_MESSAGES_HIGHEST))
83+
.thenReturn(Duration.ofSeconds(10));
84+
when(profile.getDuration(DefaultDriverOption.METRICS_NODE_CQL_MESSAGES_LOWEST))
85+
.thenReturn(Duration.ofMillis(1));
86+
when(profile.getInt(DefaultDriverOption.METRICS_NODE_CQL_MESSAGES_DIGITS)).thenReturn(5);
8287

8388
MicrometerNodeMetricUpdater updater =
8489
new MicrometerNodeMetricUpdater(node, context, enabledMetrics, new SimpleMeterRegistry());
@@ -118,6 +123,11 @@ public void should_not_log_warning_when_provided_eviction_time_setting_is_accept
118123
when(profile.getDuration(DefaultDriverOption.METRICS_NODE_EXPIRE_AFTER))
119124
.thenReturn(expireAfter);
120125
when(generator.nodeMetricId(node, DefaultNodeMetric.CQL_MESSAGES)).thenReturn(METRIC_ID);
126+
when(profile.getDuration(DefaultDriverOption.METRICS_NODE_CQL_MESSAGES_HIGHEST))
127+
.thenReturn(Duration.ofSeconds(10));
128+
when(profile.getDuration(DefaultDriverOption.METRICS_NODE_CQL_MESSAGES_LOWEST))
129+
.thenReturn(Duration.ofMillis(1));
130+
when(profile.getInt(DefaultDriverOption.METRICS_NODE_CQL_MESSAGES_DIGITS)).thenReturn(5);
121131

122132
MicrometerNodeMetricUpdater updater =
123133
new MicrometerNodeMetricUpdater(node, context, enabledMetrics, new SimpleMeterRegistry());

0 commit comments

Comments
 (0)