11package datadog .trace .core .baggage ;
22
3+ import static org .junit .jupiter .api .Assertions .assertEquals ;
34import static org .junit .jupiter .api .Assertions .assertNotNull ;
45import static org .junit .jupiter .api .Assertions .assertTrue ;
56import static org .mockito .Mockito .mock ;
2021
2122class 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