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

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.TST1;

@TestScenario(name = "Call API crt-campaign to WSO2 and assert response parameters")
public class ApiCrtCampaign {

    public static final String CRT_CAMPAIGN_PATH = "sme.cluster/crt-campaign/001";

    @TestCase(name = "Call API crt-campaign to WSO2", environments = {TST1})
    public void postCrtCampaign(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm(CRT_CAMPAIGN_PATH, true,
                        "{\n" +
                                "  \"RC\": \"\",\n" +
                                "  \"IC\": \"45272956\",\n" +
                                "  \"CATEGORY\": \"9\",\n" +
                                "  \"FIRST_NAME\": \"Emanuel\",\n" +
                                "  \"LAST_NAME\": \"Sklenář\",\n" +
                                "  \"EMAIL\": \"j.novak@seznam.cz\",\n" +
                                "  \"MOBILE\": \"+420777213293\",\n" +
                                "  \"REQUESTED_LOAN_AMOUNT\": 677.78,\n" +
                                "  \"ID_CAMPAIGN_EXT\": \"Web_express\",\n" +
                                "  \"CAMPAIGN_TYPE\": \"9\",\n" +
                                "  \"CAMPAIGN_NAME\": \"Toto je test\"\n" +
                                "}")
                .post()
                .andAssertStatus(200)
                .andAssertPresent("ID_OPPORTUNITY");
    }
}
