import com.alibaba.fastjson.serializer.SimpleDateFormatSerializer;
public class DateFieldTest6 extends TestCase {
public void test_0() throws Exception {
SerializeConfig mapping = new SerializeConfig();
mapping.put(Date.class, new SimpleDateFormatSerializer("yyyy-MM-dd"));
Entity object = new Entity();
object.setValue(new Date());
String text = JSON.toJSONString(object, mapping);
Assert.assertEquals("{\"value\":\"" + new SimpleDateFormat("yyyy-MM-dd").format(object.getValue()) + "\"}", text);