package cz.moneta.test.smoke.itp.ieandmwf;

import com.fasterxml.jackson.databind.JsonNode;
import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import org.junit.jupiter.api.Assertions;

import static cz.moneta.test.harness.annotations.Environment.*;

@TestScenario(name = "Test NAS system with MWFIQ1 - formal control")
public class CallMWFIQ1ToNAS {

    @TestCase(name = "Test NAS system with MWFIQ1.", environments = {TST1, TST3, PPE, EDU})
    @JiraTestCase(id = "TEA-T21")
    public void testDO_FAST_FORMAL_CHECK_002(Harness harness) {
        JsonNode result = harness.tasks().wso2().restRequest()
                .prepareRequestFromRefinansoHyp("/t/risk.cluster/NAS/DO_FAST_FORMAL_CHECK_002/001",
                        "{\"RS_DATA_IN\":[" +
                                "{\"FORM_ITEM\":\"firstName\", \"VALUE\":\"Štefan\"}," +
                                "{\"FORM_ITEM\":\"lastName\",\"VALUE\":\"Sudra\"}," +
                                "{\"FORM_ITEM\":\"personalId\",\"VALUE\":\"7804222470\"}," +
                                "{\"FORM_ITEM\":\"identityCard.number\",\"VALUE\":\"208243633\"}," +
                                "{\"FORM_ITEM\":\"identityCard.valid\",\"VALUE\":\"09.06.2027\"}," +
                                "{\"FORM_ITEM\":\"birthDate\",\"VALUE\":\"22.4.1978\"}" +
                                "]}")
                .post()
                .andAssertStatus(200)
                .extract("RS_DATA_OUT");

        Assertions.assertTrue(result.isEmpty());
    }
}
