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 = "change current account to Tom ucet")
public class ChangeSmartBank {
    private String bu;
    private SmokeData smokeData;

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

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T2087")
    public void MWF2C0_CHG_CURRENT_ACCOUNT_SMART_BANK(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromUfo(smokeData.getPath("MWF2C0"))
                .addField("AccountNumber", bu)
                .postExtended()
                .andAssertStatus(200)
                .andAssertPresent("Data")
                .andAssertFieldValue("Data[0].FeePlan", "460");  // Tom account
    }
}
