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


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_UNIPTINFOLIMITVAR_DATA to WSO2 and assert response parameters")
public class ApiGetUniptinfolimitvarData {

    @TestCase(name = "Call API GET_UNIPTINFOLIMITVAR_DATA to WSO2", environments = {TST1, PPE})
    public void postGetUniptinfolimitvarData(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm("data.cluster/GET_UNIPTINFOLIMITVAR_DATA/001", true,
                "{\n" +
                        "    \"UNI_PT_KEY\": " + harness.getConfig("cvm.client.infolimit.uniptkey") + "\n" +
                        "}")
                .post()
                .andAssertStatus(200)
                .andAssertPresent("RS_1")
                .andAssertPresent("RS_1[0]")
                .andAssertPresent("RS_1[0].UNI_PT_INFOLIMIT_KEY")
                .andAssertPresent("RS_1[0].INFOLIMIT_AMT")
                .andAssertPresent("RS_1[0].BUS_PROD_CLASS_CODE")
                .andAssertPresent("RS_2");
    }
}
