Skip to content

Commit

Permalink
add testcase for issue alibaba#924
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Nov 12, 2022
1 parent 3ab32e7 commit fdd9143
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/src/test/java/com/alibaba/fastjson2/issues/Issue923.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.alibaba.fastjson2.issues;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AccessLevel;
import lombok.ToString;
import lombok.Value;
Expand Down Expand Up @@ -40,4 +41,17 @@ public static class Exercise<T> {
T value;
}
}

@Test
public void test1() {
Bean1 bean = new Bean1(101);
String str = JSON.toJSONString(bean);
assertEquals("{\"ID\":101}", str);
}

@Value
public static class Bean1 {
@JSONField(name = "ID")
int id;
}
}

0 comments on commit fdd9143

Please sign in to comment.