package com.live.cases.fileManage.employeeFolder;

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

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

    /**
     * 测试员工文件列表
     */
    @Test
    public void testEmployeeFolderList(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("current","1");
        jsonObject.put("size","10");
        jsonObject.put("disk", "EMPLOYEE");
        jsonObject.put("instId", xmAppApi.getLoginInfo().getInstId());

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

        Assert.assertEquals("true", jsonBody.getString("success"));
        Assert.assertEquals("操作成功!", jsonBody.getString("message"));
        Assert.assertEquals(jsonBody.getJSONObject("result").getString("total"), Integer.toString(jsonBody.getJSONObject("result").getJSONArray("records").size()));

    }
}
