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

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 static cz.moneta.test.sanity.transactional.cards.firstvision.MESSAGE.*;

@TestScenario(name = "R3 VMX.CARDACTIVATION.UPD R8V2")
public class Activation {

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T1918")
    public void VMX_CARDACTIVATION_UPD(Harness harness) {
        String account = SmokeData.getInstance(harness).getCreditData().getAccount();
        harness.withWso2()
                .prepareRequest()
                .withPath(FV)
                .withPojoPayload(new MESSAGE("VMX.CARDACTIVATION.UPD", "R8V2"))
                .addField(VMX_MSGIN, "ACCT", account)
                .addField(VMX_MSGIN, "SVC_TYPE", "A")
                .postExtended()
                .andAssertFieldValue(SVC_RETURN, "P")
                .andAssertFieldValue(VMX_MSGOUT + ".CARD_NBR", account);
    }
}
