This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new f141a07e49c Add JsonUtilsTest (#32613)
f141a07e49c is described below

commit f141a07e49c6d3f08edd96032052f627ee8f41db
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Aug 21 17:10:20 2024 +0800

    Add JsonUtilsTest (#32613)
---
 .../infra/util/json/JsonUtilsTest.java             | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/json/JsonUtilsTest.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/json/JsonUtilsTest.java
new file mode 100644
index 00000000000..40549509e9e
--- /dev/null
+++ 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/json/JsonUtilsTest.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.util.json;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+class JsonUtilsTest {
+    
+    @Test
+    void assertToJsonStringOnNull() {
+        assertThat(JsonUtils.toJsonString(null), is("null"));
+    }
+}

Reply via email to