diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/BaseSyncClientHandlerInstrumentationTest.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/BaseSyncClientHandlerInstrumentationTest.java index c1bf45a01c..e6d0bf528e 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/BaseSyncClientHandlerInstrumentationTest.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/BaseSyncClientHandlerInstrumentationTest.java @@ -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();