Skip to content

Commit

Permalink
Merge pull request #162 from benjamin-confino/tck-with-attributes
Browse files Browse the repository at this point in the history
add type data to mapToString
  • Loading branch information
yasmin-aumeeruddy authored Feb 26, 2024
2 parents 0f00aec + 89bc9a9 commit bc00bbc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.metrics.DoubleCounter;
import io.opentelemetry.api.metrics.Meter;
Expand Down Expand Up @@ -119,9 +120,9 @@ void testDoubleCounter() throws InterruptedException {
});
}

private String mapToString(Map<?, ?> map) {
private String mapToString(Map<AttributeKey<?>, ?> map) {
return (String) map.keySet().stream()
.map(key -> "" + key + "=" + map.get(key))
.map(key -> "" + key.getKey() + "=" + map.get(key))
.collect(Collectors.joining(", ", "{", "}"));
}
}

0 comments on commit bc00bbc

Please sign in to comment.