private static final Logger log = LoggerFactory.getLogger(VodVideoManagementTest.class);
/**
* 创建弹幕
*/
@Test
public void testAddDanmu() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/danmu/"+userId+"/add";
String vid = "1b448be323b68b2999802799a98dba54_1";
String msg = "测试添加弹幕";
String time = "00:00:05";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("msg", msg);
requestMap.put("time", time);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试创建弹幕,{}", response);
//do somethings
}