Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKunz committed Mar 6, 2024
1 parent 40f4201 commit 2c182f2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,16 @@ void testExceptionRedaction() {
Throwable redacted = tracer.redactExceptionIfRequired(exception);
assertThat(redacted).isInstanceOf(RedactedException.class);

assertThat(tracer.redactExceptionIfRequired(redacted)).isSameAs(redacted);
// double redaction means no instanceof check
assertThat(tracer.redactExceptionIfRequired(redacted)).isNotSameAs(redacted);

ErrorCapture errorCapture = tracer.captureException(exception, tracer.currentContext(), null);
assertThat(errorCapture).isNotNull();
assertThat(errorCapture.getException()).isInstanceOf(RedactedException.class);

ErrorCapture alreadyRedacted = tracer.captureException(redacted, tracer.currentContext(), null);
assertThat(alreadyRedacted).isNotNull();
assertThat(alreadyRedacted.getException()).isSameAs(redacted);
assertThat(alreadyRedacted.getException()).isNotSameAs(redacted);
}


Expand Down

0 comments on commit 2c182f2

Please sign in to comment.