Esempio n. 1
0
 @Test
 public void parseUserGet() throws Exception {
   Converter jc = new JsonConverter();
   String json = TestUtils.readResource("user.json");
   User user = jc.toResponse(json, User.class, "taobao.user.get");
   Assert.assertEquals("hz0799", user.getNick());
 }
Esempio n. 2
0
 @Test
 public void parseItemsGet() throws Exception {
   Converter jc = new JsonConverter();
   String json = TestUtils.readResource("items.json");
   PageList<Item> rsp = jc.toResponseList(json, Item.class, "taobao.items.get");
   Assert.assertEquals(new Long(277L), rsp.getTotalResults());
 }
Esempio n. 3
0
 @Test
 public void parseTradesSoldGet() throws Exception {
   Converter jc = new JsonConverter();
   String json = TestUtils.readResource("trades.json");
   PageList<Trade> rsp = jc.toResponseList(json, Trade.class, "taobao.trades.sold.get");
   Assert.assertEquals(new Long(897L), rsp.getTotalResults());
   Assert.assertEquals(2, rsp.getContent().size());
 }