package com.live.cases.fileManage.commonFolder;

import com.alibaba.fastjson.JSONObject;
import com.live.xmutils.ApiBaseTest;
import com.live.xmutils.FolderMethod;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

/**
 * Created by wujie on  2020/09/16
 */
public class TestFolderList01 extends ApiBaseTest {

    @Override
    protected String getApiName(){

        return "API_folderList";
    }

//    @BeforeMethod
//    public void beforeTest(){
//        //设置测试信息：env、Apimodule、Apiname、接口账号信息、端口位
//        xmAppApi.setApiModule(ApiModele.CloudClass_Video) // API 所属模块
//            .setApiName("API_createLessonSchedule") // API 名称
//            .setEnv("rc")            // 运行环境
//            .setLoginUser("wujie_b")         // 测试账号
//            .setTerminal(Terminal.B);             // 所属端位（B端，C端，M端等, 必传）
//
//        /*dal.setCase_owner("wujie")
//            .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);*/
//
//        super.beforeTest();
//    }

    @DataProvider(name = "testData")
    public Object[][] testdata(){
            return new Object[][]{
                    {"MYSELF", 10, 1},
                    {"COMMON", 10 ,1},
                    {"EMPLOYEE", 10 ,1}
            };
    }


    @Test(dataProvider = "testData")
    public void testFolderList(String disk, int size, int current){
        //设置请求文件夹参数
//        String data = "{\"size\":10,\"current\":1,\"folderIdType\":\"FOLDER\",\"disk\":\"MYSELF\","
//            + "\"instId\":\"1290584237476061185\"}";
        //"{\"size\":10,\"current":1,"folderIdType":"FOLDER","disk":"MYSELF","instId":"1290584237476061185"}";
        //请求文件夹接口
/*        okHttpClient.doPostRequest(url, params, data, headers);
        JSONObject jsonBody = okHttpClient.getBodyInJSON();*/
//        okHttpClient.doPostRequest(url,params,data,headers);
//        JSONObject jsonBody = okHttpClient.getBodyInJSON();

        String data = FolderMethod.folderList(disk,size,current);
        JSONObject jsonBody = doRequest(data);

        Assert.assertEquals("true", jsonBody.getString("success"));

    }

}
