package cz.moneta.test.system.wso2;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;

@TestScenario(name = "calls WSO2 Enterprise Integrator")
public class EnterpriseIntegratorTest {

    @TestCase(name = "calls WSO2 Enterprise Integrator")
    public void callARequest(Harness harness) {
        harness.withWso2()
                .prepareRequestXml()
                .withPath("call-fv/v1")
                .withPayload("" +
                        "<MESSAGE>" +
                        "    <API-NAME>VMX.ACCOUNT.INQ</API-NAME>" +
                        "    <API-VERSION>E8VDA</API-VERSION>" +
                        "    <VMX_MSGIN>" +
                        "        <CONTEXT>00000MMB</CONTEXT>" +
                        "        <SIGNON_NAME/>" +
                        "        <ORG>861</ORG>" +
                        "        <ACCOUNT>0008616700200000028</ACCOUNT>" +
                        "        <DUAL_IND/>" +
                        "    </VMX_MSGIN>" +
                        "</MESSAGE>")
                .post()
                .andAssertFieldValue("VMX_ROOT.VMX_MSGOUT.SVC_RETURN", "P");
    }
}
