package cz.moneta.test.regression.commercial.smallbusiness.digital.jenkinstests.newtobank;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.openapi.smeonboarding.process.SmallBusinessOnboardingProcessUtils;
import cz.moneta.test.dsl.openapi.smeonboarding.process.start.SmallBusinessOnboardingProcessStartResponse;
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;

@TestScenario(name = "Call onboarding process start api tests")
public class OnboardingProcessStart {

    @TestCase(name = "NTB test 01 - /smeonboarding/process/start")
    @JiraTestCase(id = "SBD-T76")
    public void testProcessStart(Harness harness) {
        SmallBusinessOnboardingProcessStartResponse smallBusinessOnboardingProcessStartResponse = SmallBusinessOnboardingProcessUtils.createStartProcessUnsecuredRequest(harness)
                .post()
                .andAssertStatus(200)
                .mapResponseIntoObject(SmallBusinessOnboardingProcessStartResponse.class);

        String token = smallBusinessOnboardingProcessStartResponse.getResponseObject()
                .getToken();

        Assertions.assertNotNull(token, "Token value is null. It should contains some String.");
        Assertions.assertNotEquals("", token, "Token value has to be nonempty String.");
    }
}
