Skip to content

Commit

Permalink
add a test to check on the 21+ no redaction
Browse files Browse the repository at this point in the history
  • Loading branch information
jackshirazi committed Nov 27, 2023
1 parent 03be848 commit ae30a2c
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ public void checkRedactedExceptionWhenExceptionThrownOnCorretto17() {
assertThat(BaseSyncClientHandlerInstrumentation.RedactedException.Exceptions.get(this.getClass().getName())).isNotNull();
}

@Test
public void checkNoRedactedExceptionWhenExceptionThrownOnCorretto21() {
BaseSyncClientHandlerInstrumentation.JVM_RUNTIME_INFO = new JvmRuntimeInfo("21.0.1", "OpenJDK 64-Bit Server VM", "Amazon.com Inc.", "17.0.5+8-LTS");
assertThat(BaseSyncClientHandlerInstrumentation.JVM_RUNTIME_INFO.isCoretto()).isTrue();
assertThat(BaseSyncClientHandlerInstrumentation.JVM_RUNTIME_INFO.getMajorVersion()).isGreaterThan(16);
assertThat(exerciseRedactedException(new Exception("test3"))).isEqualTo(Outcome.FAILURE);
assertThat(BaseSyncClientHandlerInstrumentation.RedactedException.Exceptions).isEmpty();
}

public Outcome exerciseRedactedException(Exception canBeNull) {
MockTracer.MockInstrumentationSetup mockInstrumentationSetup = MockTracer.createMockInstrumentationSetup();
ElasticApmTracer tracer = mockInstrumentationSetup.getTracer();
Expand Down

0 comments on commit ae30a2c

Please sign in to comment.