提交 6ee49384 编写于 作者: S shenhongxi

CommonTest

上级 088d65f6
......@@ -21,6 +21,12 @@
<version>4.11</version>
<scope>Test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.6</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.itlong.whatsmars.base.common;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
/**
* Created by shenhongxi on 2017/8/21.
*/
public class CommonTest {
@Test
public void t() throws Exception {
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> params = new HashMap<String, Object>();
params.put("domain", "sina.im");
params.put("year", 2017);
String s = mapper.writeValueAsString(params);
System.out.println(s);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册