package cz.moneta.test.regression.cvm.api.enterpriseitservices;

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

import static cz.moneta.test.harness.annotations.Environment.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;

@TestScenario(name = "Call API CRT_MSG_EMAIL_ONLINE to WSO2 and assert response parameters")
public class ApiCrtMsgEmailOnline {

    @TestCase(name = "Call API CRT_MSG_EMAIL_ONLINE to WSO2", environments = {TST1, PPE})
    public void postCrtMsgEmailOnline(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm("enterpriseit.services/CRT_MSG_EMAIL_ONLINE/001", true,
                        "{\n" +
                                "    \"CLIENT_ADDRESS_TO\": \"michal.sida@moneta.cz\",\n" +
                                "    \"COST_CENTER_ID\": 32,\n" +
                                "    \"FORMAT_ID\": 11492,\n" +
                                "    \"GATEWAY_ADDRESS\": \"dedictvi@moneta.cz\",\n" +
                                "    \"GW_SYS_ID\": 99,\n" +
                                "    \"MESG_PARAMS\": \"PAR1|PAR2|PAR3|PAR4\"\n" +
                                "}")
                .post()
                .andAssertStatus(200)
                .andAssertPresent("MESG_ID");
    }
}
