The following issues were found

src/test/java/com/alibaba/json/bvt/issue_1700/Issue1785.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 7

              import junit.framework.TestCase;

public class Issue1785 extends TestCase {
    public void test_for_issue() throws Exception {
        JSON.parseObject("\"2006-8-9\"", java.sql.Timestamp.class);
    }
}

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 7

              import junit.framework.TestCase;

public class Issue1785 extends TestCase {
    public void test_for_issue() throws Exception {
        JSON.parseObject("\"2006-8-9\"", java.sql.Timestamp.class);
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/jdk8/LocalDateTimeTest4.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 13

              
public class LocalDateTimeTest4 extends TestCase {

    public void test_for_issue() throws Exception {
        LocalDateTime dateTime = LocalDateTime.of(2016, 5, 6, 9, 3, 16);
        VO vo = new VO();
        vo.setDate(dateTime);
        
        String text = JSON.toJSONString(vo);

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 23

                      
        VO vo1 = JSON.parseObject(text, VO.class);
        
        Assert.assertEquals(vo.getDate(), vo1.getDate());
    }

    public static class VO {

        private LocalDateTime date;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_2000/Issue2066.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              public class Issue2066 extends TestCase {


    public void test_issue() throws Exception {
        JSON.parseObject("{\"values\":[[1,2],[3,4]]}", Model.class);
    }

    public static class Model {
        private List<float[]> values;

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 11

              public class Issue2066 extends TestCase {


    public void test_issue() throws Exception {
        JSON.parseObject("{\"values\":[[1,2],[3,4]]}", Model.class);
    }

    public static class Model {
        private List<float[]> values;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_2000/Issue2074.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 8

              import junit.framework.TestCase;

public class Issue2074 extends TestCase {
    public void test_for_issue() throws Exception {
        JSONObject object = new JSONObject();
        object.put("name", null);

        assertEquals("{\"name\":null}"
                , object.toString(SerializerFeature.WriteMapNullValue));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

                      JSONObject object = new JSONObject();
        object.put("name", null);

        assertEquals("{\"name\":null}"
                , object.toString(SerializerFeature.WriteMapNullValue));
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/JSONScannerTest_scanFieldBoolean_unquote.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              
public class JSONScannerTest_scanFieldBoolean_unquote extends TestCase {

    public void test_4() throws Exception {
        String text = "{\"value\":false,id:2}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(false, obj.getValue());
    }
}

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 14

                  public void test_4() throws Exception {
        String text = "{\"value\":false,id:2}";
        VO obj = JSON.parseObject(text, VO.class);
        Assert.assertEquals(false, obj.getValue());
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/jdk8/OptionalInt_Test.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 13

              
public class OptionalInt_Test extends TestCase {

    public void test_optional() throws Exception {
        Model model = new Model();
        model.value = OptionalInt.empty();

        String text = JSON.toJSONString(model);


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 28

              

    public static class Model {
        public OptionalInt value;

    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_3300/Issue3326.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 10

              import java.util.HashMap;

public class Issue3326 extends TestCase {
    public void test_for_issue() throws Exception {
        HashMap<String, Number> map = JSON.parseObject("{\"id\":10.0}"
                , new TypeReference<HashMap<String, Number>>() {
                    }.getType()
                , 0);
        assertEquals(10.0, map.get("id"));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                              , new TypeReference<HashMap<String, Number>>() {
                    }.getType()
                , 0);
        assertEquals(10.0, map.get("id"));
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/jdk8/OptionalDouble_Test.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 13

              
public class OptionalDouble_Test extends TestCase {

    public void test_optional() throws Exception {
        Model model = new Model();
        model.value = OptionalDouble.empty();

        String text = JSON.toJSONString(model);


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 28

              

    public static class Model {
        public OptionalDouble value;

    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/guava/MultiMapTes.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 14

               */
public class MultiMapTes extends TestCase {

    public void test_multimap() throws Exception {
        Map<String, Integer> map = ImmutableMap.of("a", 1, "b", 1, "c", 2);
        SetMultimap<String, Integer> multimap = Multimaps.forMap(map);
        Multimap<Integer, String> inverse = Multimaps.invertFrom(multimap, HashMultimap.<Integer, String>create());
        String json = JSON.toJSONString(inverse);
        assertEquals("{1:[\"a\",\"b\"],2:[\"c\"]}",json);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 19

                      SetMultimap<String, Integer> multimap = Multimaps.forMap(map);
        Multimap<Integer, String> inverse = Multimaps.invertFrom(multimap, HashMultimap.<Integer, String>create());
        String json = JSON.toJSONString(inverse);
        assertEquals("{1:[\"a\",\"b\"],2:[\"c\"]}",json);
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_2700/Issue2792.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 9

              import junit.framework.TestCase;

public class Issue2792 extends TestCase {
    public void test_for_issue() throws Exception {
        String jsonpath = "$.sku[?((@.quantity != 0)&&(@.is_onsale == 1))].sku_id";

        JSONObject root = JSON.parseObject("{\"sku\":{\"quantity\":12,\"is_onsale\":1,\"sku_id\":42356}}");

        assertEquals(42356, JSONPath.eval(root, jsonpath));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

              
        JSONObject root = JSON.parseObject("{\"sku\":{\"quantity\":12,\"is_onsale\":1,\"sku_id\":42356}}");

        assertEquals(42356, JSONPath.eval(root, jsonpath));
    }
}

            

Reported by PMD.