package com.renren.api.client.services;
import java.util.Date;
import junit.framework.Assert;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.junit.Test;
import com.renren.api.client.AbstractServiceTest;
import com.renren.api.client.param.impl.AccessToken;
public class FeedServiceTest extends AbstractServiceTest{
@Test
public void testGetFeed(){
String type="10";
long uid=0;
int page=1;
int count=10;
JSONArray feeds=this.getRenrenApiClient().getFeedService().getFeed(type, uid, page, count,new AccessToken(this.getAccessToken()));
System.out.println(feeds);
Assert.assertTrue(feeds.size()>0);
}
@Test
public void testPublicFeed(){
String name="这是测试的新鲜事";
String description="我在测试新鲜是的sdk";
String url="http://dev.renren.com/";
String image="http://www.huohu123.com/static/nav/images/firefox-logo_v2.png";
String caption="测试新鲜事的CAPTION";
String action_name="新鲜事动作模块文案";
String action_link="http://wiki.dev.renren.com/wiki/SDK";
String message="用户自定义的内容 这条新鲜事发布的时间是"+new Date().toString();
JSONObject res=this.getRenrenApiClient().getFeedService().publicFeed(name, description, url, image, caption, action_name, action_link, message,new AccessToken(this.getAccessToken()));
Assert.assertTrue((Long)res.get("post_id")>0);
}
}