File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/assertions Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,8 @@ public final MetricAssert hasDataPointsWithAttributes(AttributeMatcherSet... att
264264
265265 // validate each datapoint attributes match exactly one of the provided attributes sets
266266 for (NumberDataPoint dataPoint : dataPoints ) {
267- Map <String , String > dataPointAttributes = toMap (dataPoint .getAttributesList ());
267+ Map <String , String > dataPointAttributes = dataPoint .getAttributesList ().stream ()
268+ .collect (Collectors .toMap (KeyValue ::getKey , kv -> kv .getValue ().getStringValue ()));
268269 int matchCount = 0 ;
269270 for (int i = 0 ; i < attributeMatchers .length ; i ++) {
270271 if (attributeMatchers [i ].matches (dataPointAttributes )) {
@@ -289,8 +290,4 @@ public final MetricAssert hasDataPointsWithAttributes(AttributeMatcherSet... att
289290 });
290291 }
291292
292- private static Map <String , String > toMap (List <KeyValue > list ) {
293- return list .stream ()
294- .collect (Collectors .toMap (KeyValue ::getKey , kv -> kv .getValue ().getStringValue ()));
295- }
296293}
You can’t perform that action at this time.
0 commit comments