package cz.moneta.test.regression.commercial.salesforce.api;

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

@TestScenario
public class GetElasticVersionTest {

    @TestCase
    public void getElasticVersion(Harness harness) {
        String token = harness.tasks().elasticApiTasks().getAuthorizationToken();

        RawRestRequest.Response response = harness.withElasticApi()
                .prepareReadRequest()
                .withPath("/")
                .withHeader("Authorization", "Basic " + token)
                .get()
                .andAssertStatus(200);

        harness.log("Response: " + response.extract("").toString());
    }
}
