The following issues were found

src/test/java/com/alibaba/json/bvt/issue_2200/Issue2238.java
6 issues
System.out.println is used
Design

Line: 15

                      capitalLimitMonenyDTO.setMinChargeMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMaxWithdrawMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMinWithdrawMoney(new BigDecimal("500000"));
        System.out.println(JSON.toJSONString(capitalLimitMonenyDTO));
    }

    public static class CapitalLimitMonenyDTO {
        private BigDecimal maxChargeMoney;
        private BigDecimal minChargeMoney;

            

Reported by PMD.

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 java.math.BigDecimal;

public class Issue2238 extends TestCase {
    public void test_for_issue() throws Exception {
        CapitalLimitMonenyDTO capitalLimitMonenyDTO =new CapitalLimitMonenyDTO();
        capitalLimitMonenyDTO.setMaxChargeMoney(new BigDecimal("200000"));
        capitalLimitMonenyDTO.setMinChargeMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMaxWithdrawMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMinWithdrawMoney(new BigDecimal("500000"));

            

Reported by PMD.

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

Line: 9

              import java.math.BigDecimal;

public class Issue2238 extends TestCase {
    public void test_for_issue() throws Exception {
        CapitalLimitMonenyDTO capitalLimitMonenyDTO =new CapitalLimitMonenyDTO();
        capitalLimitMonenyDTO.setMaxChargeMoney(new BigDecimal("200000"));
        capitalLimitMonenyDTO.setMinChargeMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMaxWithdrawMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMinWithdrawMoney(new BigDecimal("500000"));

            

Reported by PMD.

Avoid creating BigDecimal with a decimal (float/double) literal. Use a String literal
Error

Line: 12

                  public void test_for_issue() throws Exception {
        CapitalLimitMonenyDTO capitalLimitMonenyDTO =new CapitalLimitMonenyDTO();
        capitalLimitMonenyDTO.setMaxChargeMoney(new BigDecimal("200000"));
        capitalLimitMonenyDTO.setMinChargeMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMaxWithdrawMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMinWithdrawMoney(new BigDecimal("500000"));
        System.out.println(JSON.toJSONString(capitalLimitMonenyDTO));
    }


            

Reported by PMD.

Avoid creating BigDecimal with a decimal (float/double) literal. Use a String literal
Error

Line: 13

                      CapitalLimitMonenyDTO capitalLimitMonenyDTO =new CapitalLimitMonenyDTO();
        capitalLimitMonenyDTO.setMaxChargeMoney(new BigDecimal("200000"));
        capitalLimitMonenyDTO.setMinChargeMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMaxWithdrawMoney(new BigDecimal(0.01));
        capitalLimitMonenyDTO.setMinWithdrawMoney(new BigDecimal("500000"));
        System.out.println(JSON.toJSONString(capitalLimitMonenyDTO));
    }

    public static class CapitalLimitMonenyDTO {

            

Reported by PMD.

The class 'CapitalLimitMonenyDTO' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=8, WMC=8)
Design

Line: 18

                      System.out.println(JSON.toJSONString(capitalLimitMonenyDTO));
    }

    public static class CapitalLimitMonenyDTO {
        private BigDecimal maxChargeMoney;
        private BigDecimal minChargeMoney;
        private BigDecimal maxWithdrawMoney;
        private BigDecimal minWithdrawMoney;


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_1800/Issue_for_float_zero.java
6 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 Issue_for_float_zero extends TestCase {
    public void test_0() throws Exception {
        M1 m = new M1(1.0f);
        assertEquals("{\"val\":1.0}", JSON.toJSONString(m, SerializerFeature.WriteNullNumberAsZero));
    }

    public void test_1() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 10

              public class Issue_for_float_zero extends TestCase {
    public void test_0() throws Exception {
        M1 m = new M1(1.0f);
        assertEquals("{\"val\":1.0}", JSON.toJSONString(m, SerializerFeature.WriteNullNumberAsZero));
    }

    public void test_1() throws Exception {
        M2 m = new M2(1.0);
        assertEquals("{\"val\":1.0}", JSON.toJSONString(m, SerializerFeature.WriteNullNumberAsZero));

            

Reported by PMD.

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

                      assertEquals("{\"val\":1.0}", JSON.toJSONString(m, SerializerFeature.WriteNullNumberAsZero));
    }

    public void test_1() throws Exception {
        M2 m = new M2(1.0);
        assertEquals("{\"val\":1.0}", JSON.toJSONString(m, SerializerFeature.WriteNullNumberAsZero));
    }

    public static class M1 {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

              
    public void test_1() throws Exception {
        M2 m = new M2(1.0);
        assertEquals("{\"val\":1.0}", JSON.toJSONString(m, SerializerFeature.WriteNullNumberAsZero));
    }

    public static class M1 {
        public float val;


            

Reported by PMD.

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

Line: 19

                  }

    public static class M1 {
        public float val;

        public M1(float val) {
            this.val = val;
        }
    }

            

Reported by PMD.

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

Line: 27

                  }

    public static class M2 {
        public double val;

        public M2(double val) {
            this.val = val;
        }
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_2200/Issue2262.java
6 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 Issue2262 extends TestCase {
    public void test_for_issue() throws Exception {
        Model m = new Model();
        m.javaVersion = "1.6";

        String json = JSON.toJSONString(m);
        assertEquals("{\"java.version\":\"1.6\"}", json);

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 8

              import junit.framework.TestCase;

public class Issue2262 extends TestCase {
    public void test_for_issue() throws Exception {
        Model m = new Model();
        m.javaVersion = "1.6";

        String json = JSON.toJSONString(m);
        assertEquals("{\"java.version\":\"1.6\"}", json);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 13

                      m.javaVersion = "1.6";

        String json = JSON.toJSONString(m);
        assertEquals("{\"java.version\":\"1.6\"}", json);

        Model m2 = JSON.parseObject(json, Model.class);
        assertNotNull(m2);
        assertEquals(m.javaVersion, m2.javaVersion);
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

                      assertEquals("{\"java.version\":\"1.6\"}", json);

        Model m2 = JSON.parseObject(json, Model.class);
        assertNotNull(m2);
        assertEquals(m.javaVersion, m2.javaVersion);
    }

    public static class Model {
        @JSONField(name = "java.version")

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 17

              
        Model m2 = JSON.parseObject(json, Model.class);
        assertNotNull(m2);
        assertEquals(m.javaVersion, m2.javaVersion);
    }

    public static class Model {
        @JSONField(name = "java.version")
        public String javaVersion;

            

Reported by PMD.

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

Line: 22

              
    public static class Model {
        @JSONField(name = "java.version")
        public String javaVersion;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/bug/Bug_for_zitao.java
6 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 Bug_for_zitao extends TestCase {
    public void test_for_issue() throws Exception {
        Model m = new Model();
        ContextValueFilter v = new ContextValueFilter() {

            public Object process(BeanContext context, Object object, String name, Object value) {
                if (value == null && context != null && Number.class.isAssignableFrom(context.getFieldClass())) {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 22

                      };

        String json = JSON.toJSONString(m, v);
        assertEquals("{\"value\":-1}", json);
    }

    public static class Model {
        public Number value;
    }

            

Reported by PMD.

Found 'DU'-anomaly for variable 'm' (lines '10'-'23').
Error

Line: 10

              
public class Bug_for_zitao extends TestCase {
    public void test_for_issue() throws Exception {
        Model m = new Model();
        ContextValueFilter v = new ContextValueFilter() {

            public Object process(BeanContext context, Object object, String name, Object value) {
                if (value == null && context != null && Number.class.isAssignableFrom(context.getFieldClass())) {
                    return -1;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'm' (lines '10'-'23').
Error

Line: 10

              
public class Bug_for_zitao extends TestCase {
    public void test_for_issue() throws Exception {
        Model m = new Model();
        ContextValueFilter v = new ContextValueFilter() {

            public Object process(BeanContext context, Object object, String name, Object value) {
                if (value == null && context != null && Number.class.isAssignableFrom(context.getFieldClass())) {
                    return -1;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'v' (lines '11'-'23').
Error

Line: 11

              public class Bug_for_zitao extends TestCase {
    public void test_for_issue() throws Exception {
        Model m = new Model();
        ContextValueFilter v = new ContextValueFilter() {

            public Object process(BeanContext context, Object object, String name, Object value) {
                if (value == null && context != null && Number.class.isAssignableFrom(context.getFieldClass())) {
                    return -1;
                }

            

Reported by PMD.

Found 'DU'-anomaly for variable 'v' (lines '11'-'23').
Error

Line: 11

              public class Bug_for_zitao extends TestCase {
    public void test_for_issue() throws Exception {
        Model m = new Model();
        ContextValueFilter v = new ContextValueFilter() {

            public Object process(BeanContext context, Object object, String name, Object value) {
                if (value == null && context != null && Number.class.isAssignableFrom(context.getFieldClass())) {
                    return -1;
                }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/bug/JSONObectNullTest.java
6 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: 12

               */
public class JSONObectNullTest extends TestCase {

    public void test_for_null() throws Exception {
        Model model = JSON.parseObject("{\"value\":null}", Model.class);
    }

    public void test_for_null2() throws Exception {
        JSON.parseObject("null");

            

Reported by PMD.

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

Line: 12

               */
public class JSONObectNullTest extends TestCase {

    public void test_for_null() throws Exception {
        Model model = JSON.parseObject("{\"value\":null}", Model.class);
    }

    public void test_for_null2() throws Exception {
        JSON.parseObject("null");

            

Reported by PMD.

Avoid unused local variables such as 'model'.
Design

Line: 13

              public class JSONObectNullTest extends TestCase {

    public void test_for_null() throws Exception {
        Model model = JSON.parseObject("{\"value\":null}", Model.class);
    }

    public void test_for_null2() throws Exception {
        JSON.parseObject("null");
    }

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 16

                      Model model = JSON.parseObject("{\"value\":null}", Model.class);
    }

    public void test_for_null2() throws Exception {
        JSON.parseObject("null");
    }

    public static class Model {
        public JSONObject value;

            

Reported by PMD.

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

Line: 16

                      Model model = JSON.parseObject("{\"value\":null}", Model.class);
    }

    public void test_for_null2() throws Exception {
        JSON.parseObject("null");
    }

    public static class Model {
        public JSONObject value;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'model' (lines '13'-'14').
Error

Line: 13

              public class JSONObectNullTest extends TestCase {

    public void test_for_null() throws Exception {
        Model model = JSON.parseObject("{\"value\":null}", Model.class);
    }

    public void test_for_null2() throws Exception {
        JSON.parseObject("null");
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/ParseRestTest.java
6 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

              
public class ParseRestTest extends TestCase {

    public void test_parseRest_0() throws Exception {
        String text = "{\"f3\":333,\"f2\":222}";
        Entity entity = JSON.parseObject(text, Entity.class);
        Assert.assertEquals(0, entity.getF0());
        Assert.assertEquals(0, entity.getF1());
        Assert.assertEquals(222, entity.getF2());

            

Reported by PMD.

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

Line: 13

                  public void test_parseRest_0() throws Exception {
        String text = "{\"f3\":333,\"f2\":222}";
        Entity entity = JSON.parseObject(text, Entity.class);
        Assert.assertEquals(0, entity.getF0());
        Assert.assertEquals(0, entity.getF1());
        Assert.assertEquals(222, entity.getF2());
        Assert.assertEquals(333, entity.getF3());
    }


            

Reported by PMD.

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

Line: 14

                      String text = "{\"f3\":333,\"f2\":222}";
        Entity entity = JSON.parseObject(text, Entity.class);
        Assert.assertEquals(0, entity.getF0());
        Assert.assertEquals(0, entity.getF1());
        Assert.assertEquals(222, entity.getF2());
        Assert.assertEquals(333, entity.getF3());
    }

    public static class Entity {

            

Reported by PMD.

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

Line: 15

                      Entity entity = JSON.parseObject(text, Entity.class);
        Assert.assertEquals(0, entity.getF0());
        Assert.assertEquals(0, entity.getF1());
        Assert.assertEquals(222, entity.getF2());
        Assert.assertEquals(333, entity.getF3());
    }

    public static class Entity {


            

Reported by PMD.

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

Line: 16

                      Assert.assertEquals(0, entity.getF0());
        Assert.assertEquals(0, entity.getF1());
        Assert.assertEquals(222, entity.getF2());
        Assert.assertEquals(333, entity.getF3());
    }

    public static class Entity {

        private int f0;

            

Reported by PMD.

The class 'Entity' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=8, WMC=8)
Design

Line: 19

                      Assert.assertEquals(333, entity.getF3());
    }

    public static class Entity {

        private int f0;
        private int f1;
        private int f2;
        private int f3;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/creator/JSONCreatorFactoryTest.java
6 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 JSONCreatorFactoryTest extends TestCase {

    public void test_create() throws Exception {
        Entity entity = new Entity(123, "菜姐");
        String text = JSON.toJSONString(entity);

        Entity entity2 = JSON.parseObject(text, Entity.class);
        Assert.assertEquals(entity.getId(), entity2.getId());

            

Reported by PMD.

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

Line: 18

                      String text = JSON.toJSONString(entity);

        Entity entity2 = JSON.parseObject(text, Entity.class);
        Assert.assertEquals(entity.getId(), entity2.getId());
        Assert.assertEquals(entity.getName(), entity2.getName());
    }
    
    public void test_create_2() throws Exception {
        Entity entity = new Entity(123, "菜姐");

            

Reported by PMD.

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

Line: 19

              
        Entity entity2 = JSON.parseObject(text, Entity.class);
        Assert.assertEquals(entity.getId(), entity2.getId());
        Assert.assertEquals(entity.getName(), entity2.getName());
    }
    
    public void test_create_2() throws Exception {
        Entity entity = new Entity(123, "菜姐");
        String text = JSON.toJSONString(entity);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 22

                      Assert.assertEquals(entity.getName(), entity2.getName());
    }
    
    public void test_create_2() throws Exception {
        Entity entity = new Entity(123, "菜姐");
        String text = JSON.toJSONString(entity);
        
        ParserConfig config = new ParserConfig();
        config.setAsmEnable(false);

            

Reported by PMD.

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

Line: 30

                      config.setAsmEnable(false);
        
        Entity entity2 = JSON.parseObject(text, Entity.class, config, 0);
        Assert.assertEquals(entity.getId(), entity2.getId());
        Assert.assertEquals(entity.getName(), entity2.getName());
    }

    public static class Entity {


            

Reported by PMD.

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

Line: 31

                      
        Entity entity2 = JSON.parseObject(text, Entity.class, config, 0);
        Assert.assertEquals(entity.getId(), entity2.getId());
        Assert.assertEquals(entity.getName(), entity2.getName());
    }

    public static class Entity {

        private final int    id;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_3300/Issue3217.java
6 issues
System.out.println is used
Design

Line: 20

                      items.add(new Item("item1",category));
        items.add(new Item("item2",category));

        System.out.println(JSON.toJSONString(items,refAfterFilterTest));
    }

    public static class RefAfterFilterTest extends AfterFilter {

        private Category category = new Category("afterFilterCategory");

            

Reported by PMD.

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

Line: 12

              
public class Issue3217 extends TestCase {

    public void test_for_issue() throws Exception {
        RefAfterFilterTest refAfterFilterTest = new RefAfterFilterTest();

        List<Item> items = new ArrayList<Item>(2);
        Category category = new Category("category");
        items.add(new Item("item1",category));

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class Issue3217 extends TestCase {

    public void test_for_issue() throws Exception {
        RefAfterFilterTest refAfterFilterTest = new RefAfterFilterTest();

        List<Item> items = new ArrayList<Item>(2);
        Category category = new Category("category");
        items.add(new Item("item1",category));

            

Reported by PMD.

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

Line: 25

              
    public static class RefAfterFilterTest extends AfterFilter {

        private Category category = new Category("afterFilterCategory");

        @Override
        public void writeAfter(Object object) {

            if (object instanceof Item) {

            

Reported by PMD.

Private field 'category' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 25

              
    public static class RefAfterFilterTest extends AfterFilter {

        private Category category = new Category("afterFilterCategory");

        @Override
        public void writeAfter(Object object) {

            if (object instanceof Item) {

            

Reported by PMD.

The class 'Item' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=6, WMC=7)
Design

Line: 59

                      }
    }

    public static class Item {

        private String name;

        private Category category;


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/geo/LineStringTest.java
6 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 9

              import junit.framework.TestCase;

public class LineStringTest extends TestCase {
    public void test_geo() throws Exception {
        String str = "{\n" +
                "    \"type\": \"LineString\",\n" +
                "    \"coordinates\": [\n" +
                "        [100.0, 0.0],\n" +
                "        [101.0, 1.0]\n" +

            

Reported by PMD.

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 LineStringTest extends TestCase {
    public void test_geo() throws Exception {
        String str = "{\n" +
                "    \"type\": \"LineString\",\n" +
                "    \"coordinates\": [\n" +
                "        [100.0, 0.0],\n" +
                "        [101.0, 1.0]\n" +

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 19

                              "}";

        Geometry geometry = JSON.parseObject(str, Geometry.class);
        assertEquals(LineString.class, geometry.getClass());

        assertEquals("{\"type\":\"LineString\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));

        String str2 = JSON.toJSONString(geometry);
        assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));

            

Reported by PMD.

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

Line: 19

                              "}";

        Geometry geometry = JSON.parseObject(str, Geometry.class);
        assertEquals(LineString.class, geometry.getClass());

        assertEquals("{\"type\":\"LineString\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));

        String str2 = JSON.toJSONString(geometry);
        assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 21

                      Geometry geometry = JSON.parseObject(str, Geometry.class);
        assertEquals(LineString.class, geometry.getClass());

        assertEquals("{\"type\":\"LineString\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));

        String str2 = JSON.toJSONString(geometry);
        assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
    }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 24

                      assertEquals("{\"type\":\"LineString\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));

        String str2 = JSON.toJSONString(geometry);
        assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_2200/Issue2229.java
6 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 java.util.Date;

public class Issue2229 extends TestCase {
    public void test_for_issue() throws Exception {
        Jon jon = JSON.parseObject("{\"dStr\":\"         hahahaha        \",\"user\":{\"createtime\":null,\"id\":0,\"username\":\"  asdfsadf  asdf  asdf  \"}}", Jon.class);
        assertEquals("  asdfsadf  asdf  asdf  ", jon.user.username);
    }

    public void test_for_issue1() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 11

              public class Issue2229 extends TestCase {
    public void test_for_issue() throws Exception {
        Jon jon = JSON.parseObject("{\"dStr\":\"         hahahaha        \",\"user\":{\"createtime\":null,\"id\":0,\"username\":\"  asdfsadf  asdf  asdf  \"}}", Jon.class);
        assertEquals("  asdfsadf  asdf  asdf  ", jon.user.username);
    }

    public void test_for_issue1() throws Exception {
        Jon jon1 = JSON.parseObject("{'dStr':'         hahahaha        ','user':{'createtime':null,'id':0,'username':'  asdfsadf  asdf  asdf  '}}", Jon.class);
        assertEquals("  asdfsadf  asdf  asdf  ", jon1.user.username);

            

Reported by PMD.

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

                      assertEquals("  asdfsadf  asdf  asdf  ", jon.user.username);
    }

    public void test_for_issue1() throws Exception {
        Jon jon1 = JSON.parseObject("{'dStr':'         hahahaha        ','user':{'createtime':null,'id':0,'username':'  asdfsadf  asdf  asdf  '}}", Jon.class);
        assertEquals("  asdfsadf  asdf  asdf  ", jon1.user.username);
    }

    public static class Jon {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

              
    public void test_for_issue1() throws Exception {
        Jon jon1 = JSON.parseObject("{'dStr':'         hahahaha        ','user':{'createtime':null,'id':0,'username':'  asdfsadf  asdf  asdf  '}}", Jon.class);
        assertEquals("  asdfsadf  asdf  asdf  ", jon1.user.username);
    }

    public static class Jon {
        public String dStr;
        public User user;

            

Reported by PMD.

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

Line: 21

              
    public static class Jon {
        public String dStr;
        public User user;
    }

    public static class User {
        public int id;
        public Date createtime;

            

Reported by PMD.

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

Line: 27

                  public static class User {
        public int id;
        public Date createtime;
        public String username;
    }
}

            

Reported by PMD.