Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package datadog.trace.core.baggage;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
Expand All @@ -20,8 +21,7 @@

class BaggagePropagatorTelemetryTest {

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

@Test
void shouldDirectlyIncrementBaggageMetrics() {
Expand Down Expand Up @@ -68,6 +68,7 @@ void shouldIncrementTelemetryCounterWhenBaggageIsSuccessfullyExtracted() {
assertTrue(baggageMetric.tags.contains("header_style:baggage"));
}

@Flaky
@Test
void shouldDirectlyIncrementAllBaggageMetrics() {
BaggageMetrics baggageMetrics = BaggageMetrics.getInstance();
Expand All @@ -86,7 +87,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() {
.findFirst()
.orElse(null);
assertNotNull(injectedMetric);
assertTrue(injectedMetric.value.longValue() == 1);
assertEquals(1, injectedMetric.value.longValue());
assertTrue(injectedMetric.tags.contains("header_style:baggage"));

CoreMetricCollector.CoreMetric malformedMetric =
Expand All @@ -95,7 +96,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() {
.findFirst()
.orElse(null);
assertNotNull(malformedMetric);
assertTrue(malformedMetric.value.longValue() == 1);
assertEquals(1, malformedMetric.value.longValue());
assertTrue(malformedMetric.tags.contains("header_style:baggage"));

CoreMetricCollector.CoreMetric bytesTruncatedMetric =
Expand All @@ -107,7 +108,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() {
.findFirst()
.orElse(null);
assertNotNull(bytesTruncatedMetric);
assertTrue(bytesTruncatedMetric.value.longValue() == 1);
assertEquals(1, bytesTruncatedMetric.value.longValue());

CoreMetricCollector.CoreMetric itemsTruncatedMetric =
metrics.stream()
Expand All @@ -118,7 +119,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() {
.findFirst()
.orElse(null);
assertNotNull(itemsTruncatedMetric);
assertTrue(itemsTruncatedMetric.value.longValue() == 1);
assertEquals(1, itemsTruncatedMetric.value.longValue());
}

@Flaky
Expand Down
Loading