Skip to content

Commit 9f89a0b

Browse files
Marked test as flaky. Fixed warnings highlighted by IDEA. (#11102)
Marked test as flaky. Fixed warnings highlighted by IDEA. Co-authored-by: alexey.kuznetsov <alexey.kuznetsov@datadoghq.com>
1 parent 140eee9 commit 9f89a0b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dd-trace-core/src/test/java/datadog/trace/core/baggage/BaggagePropagatorTelemetryTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package datadog.trace.core.baggage;
22

3+
import static org.junit.jupiter.api.Assertions.assertEquals;
34
import static org.junit.jupiter.api.Assertions.assertNotNull;
45
import static org.junit.jupiter.api.Assertions.assertTrue;
56
import static org.mockito.Mockito.mock;
@@ -20,8 +21,7 @@
2021

2122
class BaggagePropagatorTelemetryTest {
2223

23-
private static final CarrierVisitor<Map<String, String>> MAP_VISITOR =
24-
(map, consumer) -> map.forEach(consumer);
24+
private static final CarrierVisitor<Map<String, String>> MAP_VISITOR = Map::forEach;
2525

2626
@Test
2727
void shouldDirectlyIncrementBaggageMetrics() {
@@ -68,6 +68,7 @@ void shouldIncrementTelemetryCounterWhenBaggageIsSuccessfullyExtracted() {
6868
assertTrue(baggageMetric.tags.contains("header_style:baggage"));
6969
}
7070

71+
@Flaky
7172
@Test
7273
void shouldDirectlyIncrementAllBaggageMetrics() {
7374
BaggageMetrics baggageMetrics = BaggageMetrics.getInstance();
@@ -86,7 +87,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() {
8687
.findFirst()
8788
.orElse(null);
8889
assertNotNull(injectedMetric);
89-
assertTrue(injectedMetric.value.longValue() == 1);
90+
assertEquals(1, injectedMetric.value.longValue());
9091
assertTrue(injectedMetric.tags.contains("header_style:baggage"));
9192

9293
CoreMetricCollector.CoreMetric malformedMetric =
@@ -95,7 +96,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() {
9596
.findFirst()
9697
.orElse(null);
9798
assertNotNull(malformedMetric);
98-
assertTrue(malformedMetric.value.longValue() == 1);
99+
assertEquals(1, malformedMetric.value.longValue());
99100
assertTrue(malformedMetric.tags.contains("header_style:baggage"));
100101

101102
CoreMetricCollector.CoreMetric bytesTruncatedMetric =
@@ -107,7 +108,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() {
107108
.findFirst()
108109
.orElse(null);
109110
assertNotNull(bytesTruncatedMetric);
110-
assertTrue(bytesTruncatedMetric.value.longValue() == 1);
111+
assertEquals(1, bytesTruncatedMetric.value.longValue());
111112

112113
CoreMetricCollector.CoreMetric itemsTruncatedMetric =
113114
metrics.stream()
@@ -118,7 +119,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() {
118119
.findFirst()
119120
.orElse(null);
120121
assertNotNull(itemsTruncatedMetric);
121-
assertTrue(itemsTruncatedMetric.value.longValue() == 1);
122+
assertEquals(1, itemsTruncatedMetric.value.longValue());
122123
}
123124

124125
@Flaky

0 commit comments

Comments
 (0)