Skip to content

Commit

Permalink
FIX: traceState not required in Link (#2363)
Browse files Browse the repository at this point in the history
Signed-off-by: George Chen <qchea@amazon.com>
  • Loading branch information
chenqi0805 committed Mar 3, 2023
1 parent 567e3bf commit 6d4eb42
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ private DefaultLink(final Builder builder) {
checkArgument(!builder.spanId.isEmpty(), "spanId cannot be an empty String");
this.spanId = builder.spanId;

checkNotNull(builder.traceState, "traceState cannot be null");
checkArgument(!builder.traceState.isEmpty(), "traceState cannot be an empty String");
this.traceState = builder.traceState;

this.attributes = builder.attributes == null ? new HashMap<>() : builder.attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,6 @@ public void testBuilder_withMissingTraceId_throwsNullPointerException() {
assertThrows(NullPointerException.class, builder::build);
}

@Test
public void testBuilder_withMissingTraceState_throwsNullPointerException() {

builder.withTraceState(null);

assertThrows(NullPointerException.class, builder::build);
}

@Test
public void testBuilder_withEmptySpanId_throwsIllegalArgumentException() {

Expand All @@ -193,14 +185,6 @@ public void testBuilder_withEmptyTraceId_throwsIllegalArgumentException() {
assertThrows(IllegalArgumentException.class, builder::build);
}

@Test
public void testBuilder_withEmptyTraceState_throwsIllegalArgumentException() {

builder.withTraceState("");

assertThrows(IllegalArgumentException.class, builder::build);
}

@Test
public void testBuilder_withMissingAttributes_setsAttributesToEmptySet() {

Expand Down

0 comments on commit 6d4eb42

Please sign in to comment.