File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
main/java/software/amazon/lambda/powertools/tracing
test/java/software/amazon/lambda/powertools/tracing Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,9 @@ public void beforeCheckpoint(Context<? extends Resource> context) throws Excepti
235
235
serviceName ();
236
236
237
237
// Initialize ObjectMapper for JSON serialization
238
- objectMapper .writeValueAsString ("dummy" );
238
+ if (objectMapper != null ) {
239
+ objectMapper .writeValueAsString ("dummy" );
240
+ }
239
241
}
240
242
241
243
@ Override
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ void testPrimeMethodDoesNotThrowException() {
34
34
@ Test
35
35
void testTracingUtilsLoadsSuccessfully () {
36
36
// Simply calling TracingUtils.prime() should trigger CRaC registration
37
- TracingUtils .prime ();
38
- // If we get here without exception, the test passes
37
+ assertThatNoException ().isThrownBy (() -> TracingUtils .prime ());
38
+
39
+ // Verify that TracingUtils class is loaded and accessible
40
+ assertThatNoException ().isThrownBy (() -> TracingUtils .objectMapper ());
39
41
}
40
42
}
You can’t perform that action at this time.
0 commit comments