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.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;

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

    @TestCase(name = "Call API GET_APP_LST_016 to WSO2", environments = {TST1, PPE})
    public void postGetAppLst016(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm("risk.cluster/NAS/GET_APP_LST_016/001", true,
                "{\n" +
                        "  \"CIF_IN\": 3000056095,\n" +
                        "  \"RWS_DATA_01\": [\n" +
                        "    {\n" +
                        "      \"APP_STATE_IN\": null\n" +
                        "    }\n" +
                        " ],\n" +
                        "  \"RWS_DATA_02\": [\n" +
                        "    {\n" +
                        "      \"FE_CHANNEL_IN\": \"SBA\"\n" +
                        "    }\n" +
                        "  ],\n" +
                        "  \"RWS_DATA_03\": [\n" +
                        "    {\n" +
                        "      \"BUS_PROD_CLASS_IN\": \"50\"  }\n" +
                        "  ],\n" +
                        "  \"RWS_DATA_05\": [\n" +
                        "    {\n" +
                        "      \"EMPLOYEE_PROCESS_ROLE\": null\n" +
                        "    }\n" +
                        "  ]\n" +
                        "}")
                .post()
                .andAssertStatus(200)
                .andAssertFieldValue("tifResponseStatus.resultCode", "0")
                .andAssertPresent("RWS_DATA_04");
    }
}
