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.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.BeforeAll;

@TestScenario(name = "CARD MEMOS")
public class CardMemo {
    private String card;
    private String memo;
    private SmokeData smokeData;

    @BeforeAll
    public void getInfo(Harness harness) {
        smokeData = SmokeData.getInstance(harness);
        CardData creditData = smokeData.getCreditData();
        card = creditData.getCard();
        memo = RandomStringUtils.randomAlphabetic(15);
    }

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T1970")
    public void MWFJ93_CRT_ACCOUNT_ACTION_MEMO(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromUfo(smokeData.getPath("MWFJ93"))
                .addField("CisloKarty", card)
                .addField("Poznamka", memo)
                .postExtended()
                .andAssertStatus(200);
    }
}

