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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.wso2.data.CardData;
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 = "CARD MEMOS")
public class MemoInq {
    private String account;
    private String card;
    private SmokeData smokeData;

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

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T1944")
    public void MWFA94AccountAactionGetList(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromUfo(smokeData.getPath("MWFA94"))
                .addField("CisloKaretnihoUctu", account)
                .addField("CisloKarty", card)
                .postExtended()
                .andAssertStatus(200)
                .andAssertPresent("Data")
                .andAssertPresent("Data[0].Operator")
                .andAssertPresent("Data[0].Datum")
                .andAssertPresent("Data[0].Cas")
                .andAssertPresent("Data[0].AkcniKod")
                .extract("Data");

    }
}

