package cz.moneta.test.regression.cvm.api.risk;


import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;

import static cz.moneta.test.harness.annotations.Environment.TST1;

@TestScenario(name = "Call API GET_RQ_DOCS_VARIANT_003 to WSO2 and assert response parameters")
public class ApiGetRqDocsVariant003 {

    @TestCase(name = "Call API GET_RQ_DOCS_VARIANT_003 to WSO2", environments = {TST1})
    public void postGetRqDocsVariant003(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm("risk.cluster/NAS/GET_RQ_DOCS_VARIANT_003/001", true,
                "{" +
                        "    \"RS_DATA_IN\": [\n" +
                        "        {\n" +
                        "            \"APP_KEY\": 68048358\n" +
                        "        }\n" +
                        "    ]\n" +
                        "}")
                .post()
                .andAssertStatus(200)
                .andAssertFieldValue("tifResponseStatus.resultCode", "0")
                .andAssertPresent("RS_DATA_OUT")
                .andAssertPresent("RS_DATA_OUT[0]")
                .andAssertPresent("RS_DATA_OUT[0].DOC_TP")
                .andAssertPresent("RS_DATA_OUT[0].REQD_DOC_CATG")
                .andAssertPresent("RS_DATA_OUT[0].REQD_DOC_PURP");
    }
}
