Skip to content

Commit

Permalink
one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Nov 16, 2024
1 parent 94d3946 commit 4b26192
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,21 @@ void setAttribute() {
.setAttribute("long", 12345L)
.setAttribute("double", .12345)
.setAttribute("boolean", true)
.setAttribute(stringKey("stringAttribute"), "attrvalue");
.setAttribute(stringKey("stringAttribute"), "attrvalue")
.setAttribute(longKey("longAttribute"), 123);

SdkSpan span = (SdkSpan) spanBuilder.startSpan();
try {
SpanData spanData = span.toSpanData();
Attributes attrs = spanData.getAttributes();
assertThat(attrs.size()).isEqualTo(5);
assertThat(attrs.size()).isEqualTo(6);
assertThat(attrs.get(stringKey("string"))).isEqualTo("value");
assertThat(attrs.get(longKey("long"))).isEqualTo(12345L);
assertThat(attrs.get(doubleKey("double"))).isEqualTo(0.12345);
assertThat(attrs.get(booleanKey("boolean"))).isEqualTo(true);
assertThat(attrs.get(stringKey("stringAttribute"))).isEqualTo("attrvalue");
assertThat(spanData.getTotalAttributeCount()).isEqualTo(5);
assertThat(attrs.get(longKey("longAttribute"))).isEqualTo(123);
assertThat(spanData.getTotalAttributeCount()).isEqualTo(6);
} finally {
span.end();
}
Expand Down

0 comments on commit 4b26192

Please sign in to comment.