Skip to content

Commit

Permalink
ShimUtilTest | Added exception type along with message (#4745)
Browse files Browse the repository at this point in the history
* Added exception type along with message

* Added new line
  • Loading branch information
SampathKumarAmex authored Sep 12, 2022
1 parent 05b045e commit 6c6a5fd
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ void spanWrapper() {
assertThat(ShimUtil.getSpanShim(shim)).isEqualTo(shim);
assertThat(ShimUtil.getSpanShim(new SpanWrapper(shim))).isEqualTo(shim);
assertThatThrownBy(() -> ShimUtil.getSpanShim(new SpanWrapper("not a span")))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("span wrapper didn't return a span: java.lang.String");
assertThatThrownBy(() -> ShimUtil.getSpanShim(null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("span is not a valid SpanShim object: null");
}

Expand All @@ -51,6 +53,7 @@ void getContextShim() {
SpanContextShim contextShim = new SpanContextShim(new SpanShim(telemetryInfo, span));
assertThat(ShimUtil.getContextShim(contextShim)).isEqualTo(contextShim);
assertThatThrownBy(() -> ShimUtil.getContextShim(null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("context is not a valid SpanContextShim object: null");
}
}

0 comments on commit 6c6a5fd

Please sign in to comment.