<?php

namespace AsyncAws\Athena\Tests\Unit\Result;

use AsyncAws\Athena\Result\StartCalculationExecutionResponse;
use AsyncAws\Core\Response;
use AsyncAws\Core\Test\Http\SimpleMockedResponse;
use AsyncAws\Core\Test\TestCase;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;

class StartCalculationExecutionResponseTest extends TestCase
{
    public function testStartCalculationExecutionResponse(): void
    {
        // see https://docs.aws.amazon.com/athena/latest/APIReference/API_StartCalculationExecution.html
        $response = new SimpleMockedResponse('{
           "CalculationExecutionId": "uid-40555-5df4556",
           "State": "QUEUED"
        }');

        $client = new MockHttpClient($response);
        $result = new StartCalculationExecutionResponse(new Response($client->request('POST', 'http://localhost'), $client, new NullLogger()));

        self::assertSame('uid-40555-5df4556', $result->getCalculationExecutionId());
        self::assertSame('QUEUED', $result->getState());
    }
}
