public static String toJson(Object obj) {
        try {
            return mapper.writeValueAsString(obj);
        } catch (JsonProcessingException e) {
            throw new NacosSerializationException(obj.getClass(), e);
        }
    }
@Test
    void testToJson2() {
        assertThrows(NacosSerializationException.class, () -> {
            // object without field will throw exceptions
            JacksonUtils.toJson(new Object());
        });
    }