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 = "Card promos")
public class PromoCodes {
    private String account;
    private SmokeData smokeData;

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

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T1974")
    public void MWFJX5GetCardPromoListByAccount(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromUfo(smokeData.getPath("MWFJX5"))
                .addField("ACCOUNT", account)
                .postExtended()
                .andAssertStatus(200)
                .andAssertPresent("NBR_OF_RECS")
                .andAssertPresent("Data");
    }
}
