package com.live.cases.apollo;

import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.xmutils.GetLiveCourseId;
import com.live.utils.XMBaseTest;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;


/**
 * title 客户端获取直播课下转码后的文档列表
 * by 张雨朦-->zhangying
 */

public class TestGetCourseDocList extends XMBaseTest {


    @BeforeMethod
    public void beforeTest() {
        xmAppApi.setApiModule(ApiModele.CloudClass_apollo)
                .setApiName("API_getCourseDocList")
                .setLoginUser("zhangy-b")
                .setTerminal(Terminal.B);
        dal.setCase_owner("张莹");
        super.beforeTest();
    }

    @Test
    public void getCourseDocList() {
//        GetLiveCourseId tools = new GetLiveCourseId();
//        String id = tools.createCourse();

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("liveCourseId", "1356798987214893057");

        xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers);
        JSONObject responseRes = xmAppApi.getBodyInJSON();
        System.out.println("responseRes= "+responseRes);
        Assert.assertNotEquals(0,responseRes.getJSONArray("result").size());
        Assert.assertEquals("true", responseRes.getString("success"));
        Assert.assertEquals("操作成功!", responseRes.getString("message"));
//        Assert.assertNotNull(responseRes);
    }
}
