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

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 = "DO_CARD_SERV_ADJUST_DATA")
public class Limits {
    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-T1980")
    public void MWFX01GetCardDetailAtmLimit(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromAtm(smokeData.getPath("MWFX01"))
                .addField("CisloKarty", card)
                .postExtended()
                .andAssertStatus(200)
                .andAssertPresent("Limit");
    }

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T1952")
    public void MWFBB9GetCardListClientCard(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromUfo(smokeData.getPath("MWFBB9"))
                .addField("CARD_NUMBER", card)
                .postExtended()
                .andAssertStatus(200)
                .andAssertPresent("Data[0].AUTH_LIMIT_AMOUNT_POS");
    }
}
