package com.live.cases.fileManage.commonFolder;

import com.alibaba.fastjson.JSONObject;
import com.live.xmutils.baseapi.ApiBaseTestFile;
import com.live.utils.RandomStringUtil;
import org.testng.Assert;
import org.testng.annotations.Test;


/**
 * Created by zhangying on  2020/11/16
 */
public class TestRenameFolder extends ApiBaseTestFile {
    @Override
    public String getApiName() {
        return "API_renameFolde";
    }

    /**
     * 文件夹重命名
     */
    @Test
    public void testRenameFolder(){

        String name = "自动化测试文件夹"+ RandomStringUtil.randomString(6);  //文件夹名称

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id","1328233404495687681");
        jsonObject.put("name", name);

        xmAppApi.doPost(okHttpClient, url, params, jsonObject.toJSONString() , headers);
        JSONObject jsonBody = okHttpClient.getBodyInJSON();

        Assert.assertEquals("true", jsonBody.getString("success"));
        Assert.assertEquals("操作成功!", jsonBody.getString("message"));

    }

}
