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

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 = "declip-process/save-document")
public class DeclipSaveDocument {
    private String card;
    private String contract;
    private String rc;
    private SmokeData smokeData;

    @BeforeAll
    public void getInfo(Harness harness) {
        smokeData = SmokeData.getInstance(harness);
        CardData creditData = smokeData.getCreditData();
        card = creditData.getCard();
        contract = creditData.getContract();
        rc = creditData.getRc();
    }

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T2728")
    public void MWFFK8_DECLIP_PROCESS_SAVE_DOCUMENT(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromWps(smokeData.getPath("MWFFK8"))
                .addField("CisloKarty", card)
                .addField("ContractNumber", contract)
                .addField("GERodneCislo", rc)
                .addField("ProductClass", "1")
                .postExtended()
                .andAssertStatus(200)
                .andAssertPresent("URLDoc")
                .andAssertPresent("DocumentID");
    }
}
