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

    @TestCase(name = "Call API DO_INFOLIMIT_011 to WSO2", environments = {TST1, PPE})
    public void postDoInfolimit011(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm("risk.cluster/NAS/DO_INFOLIMIT_011/001", true,
                "{\n" +
                        "  \"RC\": \"0123456789\",\n" +
                        "  \"CONTRACT_ID\": \"0123456789\",\n" +
                        "  \"CONTRACT_SYSTEM\": null,\n" +
                        "  \"NAME\": \"Jan\",\n" +
                        "  \"SURNAME\": \"Novák\",\n" +
                        "  \"ICO\": \"01234567\",\n" +
                        "  \"CLIENT_TYPE\": null,\n" +
                        "  \"POS_ID\": \"86001430\",\n" +
                        "  \"ONLINE_CHECK\": \"0\",\n" +
                        "  \"DISTR_CHANNEL_ID\": \"POS\",\n" +
                        "  \"UID\": 123456,\n" +
                        "  \"CACHE_MODE\": 0\n" +
                        "}")
                .post()
                .andAssertStatus(200)
                .andAssertFieldValue("tifResponseStatus.resultCode", "0")
                .andAssertPresent("RS_DATA")
                .andAssertPresent("RS2_DATA");
    }
}
