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 = "CARD_SERVICING_DIRECT_DEBIT")
public class DirectDebit {
    private String card;
    private String bu;
    private SmokeData smokeData;

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

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T1961")
    public void MWFH02plus_CARD_SERVICING_DIRECT_DEBIT(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromUfo(smokeData.getPath("MWFH02+"))
                .addField("CisloKarty", card)
                .addField("ZpusobUhrady", "7")
                .addField("KodBanky", "0600")
                .addField("CisloBU", bu)
                .postExtended()
                .andAssertStatus(200);
    }
}
