private final Logger log = LoggerFactory.getLogger(getClass());
/**
* 新增组织
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void createOrganizationTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/user/organization/create";
String parentId = "2730";
String name = "测试部门";
String description = "负责以解决客户业务测试问题为目的的测试解决方案架构和研发工作";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("parentId", parentId);
jsonMap.put("name", name);
jsonMap.put("description", description);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, JSON.toJSONString(jsonMap), null);
log.info("测试新增组织成功:{}", response);
//do somethings
}