protected String getErrorJson(String message) {

        try {
            return LambdaContainerHandler.getObjectMapper().writeValueAsString(new ErrorModel(message));
        } catch (JsonProcessingException e) {
            log.error("Could not produce error JSON", e);
            return "{ \"message\": \"" + message + "\" }";
        }
    }
@Test
    void getErrorJson_JsonParsinException_validJson()
            throws IOException {
        ObjectMapper mockMapper = mock(ObjectMapper.class);
        JsonProcessingException exception = mock(JsonProcessingException.class);
        when(mockMapper.writeValueAsString(any(Object.class))).thenThrow(exception);

        String output = exceptionHandler.getErrorJson(INVALID_RESPONSE_MESSAGE);
        assertNotNull(output);
        ErrorModel error = objectMapper.readValue(output, ErrorModel.class);
        assertNotNull(error);
        assertEquals(INVALID_RESPONSE_MESSAGE, error.getMessage());
    }