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 org.junit.jupiter.api.Disabled;

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

@TestScenario(name = "Call API message-send to WSO2 and assert response parameters")
@Disabled
public class ApiMessageSend {

    public static final String MESSAGE_SEND_PATH = "enterpriseit.services/message/send/001";

    @TestCase(name = "Call API message-send to WSO2", environments = {TST1, PPE})
    public void postMessageSend(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm(MESSAGE_SEND_PATH, true,
                        "{\n" +
                                "  \"communicationCode\": \"MMB_WHATSAPP_CVM_API\",\n" +
                                "  \"reference\": \"12345\",\n" +
                                "  \"cif\": \"9000671065\",\n" +
                                "  \"senderInfo\": \"MONETA\",\n" +
                                "  \"telephoneNumber\": \"420776028798\",\n" +
                                "  \"channels\": [\n" +
                                "    {\n" +
                                "      \"channel\": \"WHATSAPP\"\n" +
                                "    }\n" +
                                "  ],\n" +
                                "  \"personalStateRegistrationNumber\": \"1000012217\",\n" +
                                "  \"messageDetails\": [\n" +
                                "    {\n" +
                                "      \"detailValue\": \"Vážený pane\",\n" +
                                "      \"detailKey\": \"SALUTATION_DEC_5\"\n" +
                                "    },\n" +
                                "    {\n" +
                                "      \"detailValue\": \"Vomáčko\",\n" +
                                "      \"detailKey\": \"SUB1_LAST_NAME_DEC_5\"\n" +
                                "    },\n" +
                                "    {\n" +
                                "      \"detailValue\": \"OP\",\n" +
                                "      \"detailKey\": \"CALC_ITEM_1\"\n" +
                                "    }\n" +
                                "  ],\n" +
                                "  \"createdBy\": \"123007844\",\n" +
                                "  \"templateAlias\": \"870005\",\n" +
                                "  \"partyId\": \"850980\",\n" +
                                "  \"isTesting\": true\n" +
                                "}")
                .post()
                .andAssertStatus(200)
                .andAssertPresent("messageId");
    }
}
