package cz.moneta.test.sanity.transactional.cards.wso2;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.Environment;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import cz.moneta.test.sanity.transactional.SmokeData;
import org.junit.jupiter.api.BeforeAll;

@TestScenario(name = "CHK_ETM_CLIENT_CONTACT_CMPG")
public class CheckClientContactCMPG {
    private SmokeData smokeData;
    private String card;

    @BeforeAll
    public void getInfo(Harness harness) {
        smokeData = SmokeData.getInstance(harness);
        card = smokeData.getCreditData().getCard();
    }

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T2097")
    public void MWFBV1_CHK_ETM_CLIENT_CONTACT_CMPG(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromWps(smokeData.getPath("MWFBV1"))
                .addField("campVerifCodes", "5")
                .addField("cardNumber", card)
                .addField("instPtKey", "0")
                .addField("srcSysId", "4")
                .postExtended()
                .andAssertStatus(200)
                .andAssertFieldValue("failedTypeId", "16");
    }
}
