修复 日期错误的BUG
Change-Id: If1c03b641341f9287061c2c58c64ff389056189b
This commit is contained in:
parent
08f8c10589
commit
eb9fb65544
|
@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* @author robin
|
||||
|
@ -24,6 +25,10 @@ public abstract class JsonKit {
|
|||
MAPPER.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
|
||||
MAPPER.setSerializationInclusion(JsonInclude.Include.NON_ABSENT);
|
||||
MAPPER.setDefaultPropertyInclusion(JsonInclude.Include.NON_DEFAULT);
|
||||
|
||||
SimpleDateFormat defaultDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
MAPPER.setDateFormat(defaultDateFormat);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ public class WordPressTest {
|
|||
post.setCategories("分类");
|
||||
post.setTags("a", "b", "c");
|
||||
post.setPostName("test-post-name");
|
||||
post.setPostDateGmt(System.currentTimeMillis());
|
||||
int postId = wp.newPost(post);
|
||||
System.out.println(postId);
|
||||
Assert.assertNotNull(postId);
|
||||
|
|
Loading…
Reference in New Issue