package net.polyv.live.account;
import net.polyv.LiveBaseTest;
import net.polyv.util.HttpUtil;
import net.polyv.util.LiveSignUtil;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
public class AccountTest extends LiveBaseTest {
private static final Logger log = LoggerFactory.getLogger(AccountTest.class);
/**
* 修改直播频道分类名称
* @throws IOException
*/
@Test
public void testUpdateCategoryName() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/small-class/xx/xx";
String categoryId = "345134";
String categoryName = "分类234";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("categoryId",categoryId);
requestMap.put("categoryName",categoryName);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.info("测试修改直播频道分类名称,返回值:{}",response);
//do somethings
}
}