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

    @TestCase(name = "Call API GET_APP_ID to WSO2", environments = {TST1, PPE})
    public void postGetAppId(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm("risk.cluster/NAS/GET_APP_ID/001", true,
                "{\n" +
                        "  \"APP_KEY\": " + harness.getConfig("cvm.application.getappid.key") + "\n" +
                        "}")
                .post()
                .andAssertStatus(200)
                .andAssertFieldValue("tifResponseStatus.resultCode", "0")
                .andAssertPresent("APP_ID");
    }
}
