AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Typedefs | Functions | Variables
alexaClientSDK::alexaLiveViewController::test Namespace Reference

Classes

class  AlexaLiveViewControllerCapabilityAgentTest
 
class  MockAlexaLiveViewControllerInterface
 
class  MockRtcscAppClient
 

Typedefs

using EndpointIdentifier = endpoints::EndpointIdentifier
 For readability. More...
 

Functions

static std::chrono::milliseconds TIMEOUT (1000)
 Timeout when waiting for futures to be set. More...
 
static const EndpointIdentifier TEST_ENDPOINT_ID ("testEndpointId")
 The test EndpointId. More...
 
static const std::string MESSAGE_ID ("messageId")
 MessageId key. More...
 
static const std::string MESSAGE_ID_TEST ("MessageId_Test")
 MessageId for testing. More...
 
static const std::string DIALOG_REQUEST_ID ("dialogRequestId")
 Dialog request Id key. More...
 
static const std::string DIALOG_REQUEST_ID_TEST ("DialogRequestId_Test")
 DialogRequestId for testing. More...
 
static const std::string CORRELATION_TOKEN ("correlationToken")
 Correlation token key. More...
 
static const std::string CORRELATION_TOKEN_TEST ("CorrelationToken_Test")
 Correlation token for testing. More...
 
static const std::string EVENT_CORRELATION_TOKEN ("eventCorrelationToken")
 Event correlation token key. More...
 
static const std::string EVENT_CORRELATION_TOKEN_TEST ("EventCorrelationToken_Test")
 Event correlation for testing. More...
 
static void verifySendMessage (std::shared_ptr< avsCommon::avs::MessageRequest > request, const std::string expectedEventName, const std::string expectedPayload, const std::string expectedNameSpace)
 
std::shared_ptr< AVSDirectivebuildAVSDirective (std::string directiveName)
 
 TEST_F (AlexaLiveViewControllerCapabilityAgentTest, test_givenInvalidParameters_create_shouldFail)
 Test that create() returns a nullptr if called with invalid arguments. More...
 
 TEST_F (AlexaLiveViewControllerCapabilityAgentTest, test_liveViewDirectives_successCase)
 
 TEST_F (AlexaLiveViewControllerCapabilityAgentTest, test_startLiveViewDirective_errorCase)
 
 TEST_F (AlexaLiveViewControllerCapabilityAgentTest, test_stopLiveViewDirective_errorCase)
 
 TEST_F (AlexaLiveViewControllerCapabilityAgentTest, test_unknownDirective)
 

Variables

static const std::string NAMESPACE {"Alexa.Camera.LiveViewController"}
 The namespace for capability agent. More...
 
static const std::string INTERFACE_VERSION {"1.7"}
 The supported version. More...
 
static const std::string NAME_STARTLIVEVIEW {"StartLiveView"}
 The name for StartLiveView directive. More...
 
static const std::string NAME_STOPLIVEVIEW {"StopLiveView"}
 The name for StopLiveView directive. More...
 
static const std::string UNKNOWN_DIRECTIVE {"Unknown"}
 An unknown directive signature. More...
 
static const std::string LIVE_VIEW_STARTED_EVENT {"LiveViewStarted"}
 The LiveViewStarted event signature. More...
 
static const std::string LIVE_VIEW_STOPPED_EVENT {"LiveViewStopped"}
 The LiveViewStopped event signature. More...
 
static const std::string MESSAGE_EVENT_KEY = "event"
 JSON key for the event section of a message. More...
 
static const std::string MESSAGE_HEADER_KEY = "header"
 JSON key for the header section of a message. More...
 
static const std::string MESSAGE_PAYLOAD_KEY = "payload"
 JSON key for the payload section of an message. More...
 
static const std::string MESSAGE_NAMESPACE_KEY = "namespace"
 JSON key for the namespace field of a message header. More...
 
static const std::string MESSAGE_NAME_KEY = "name"
 JSON key for the name field of a message header. More...
 
static const std::string START_LIVE_VIEW_PAYLOAD
 Sample StartLiveView payload. More...
 
static const std::string STOP_LIVE_VIEW_PAYLOAD
 Sample StopLiveView payload. More...
 
static const std::string EXPECTED_LIVE_VIEW_STARTED_PAYLOAD
 Expected LiveViewStarted payload for test purposes. More...
 
static const std::string EXPECTED_LIVE_VIEW_STOPPED_PAYLOAD
 Expected LiveViewStopped payload for test purposes. More...
 

Typedef Documentation

◆ EndpointIdentifier

For readability.

Function Documentation

◆ buildAVSDirective()

std::shared_ptr<AVSDirective> alexaClientSDK::alexaLiveViewController::test::buildAVSDirective ( std::string  directiveName)

◆ CORRELATION_TOKEN()

static const std::string alexaClientSDK::alexaLiveViewController::test::CORRELATION_TOKEN ( "correlationToken"  )
static

Correlation token key.

◆ CORRELATION_TOKEN_TEST()

static const std::string alexaClientSDK::alexaLiveViewController::test::CORRELATION_TOKEN_TEST ( "CorrelationToken_Test"  )
static

Correlation token for testing.

◆ DIALOG_REQUEST_ID()

static const std::string alexaClientSDK::alexaLiveViewController::test::DIALOG_REQUEST_ID ( "dialogRequestId"  )
static

Dialog request Id key.

◆ DIALOG_REQUEST_ID_TEST()

static const std::string alexaClientSDK::alexaLiveViewController::test::DIALOG_REQUEST_ID_TEST ( "DialogRequestId_Test"  )
static

DialogRequestId for testing.

◆ EVENT_CORRELATION_TOKEN()

static const std::string alexaClientSDK::alexaLiveViewController::test::EVENT_CORRELATION_TOKEN ( "eventCorrelationToken"  )
static

Event correlation token key.

◆ EVENT_CORRELATION_TOKEN_TEST()

static const std::string alexaClientSDK::alexaLiveViewController::test::EVENT_CORRELATION_TOKEN_TEST ( "EventCorrelationToken_Test"  )
static

Event correlation for testing.

◆ MESSAGE_ID()

static const std::string alexaClientSDK::alexaLiveViewController::test::MESSAGE_ID ( "messageId"  )
static

MessageId key.

◆ MESSAGE_ID_TEST()

static const std::string alexaClientSDK::alexaLiveViewController::test::MESSAGE_ID_TEST ( "MessageId_Test"  )
static

MessageId for testing.

◆ TEST_ENDPOINT_ID()

static const EndpointIdentifier alexaClientSDK::alexaLiveViewController::test::TEST_ENDPOINT_ID ( "testEndpointId"  )
static

The test EndpointId.

◆ TEST_F() [1/5]

alexaClientSDK::alexaLiveViewController::test::TEST_F ( AlexaLiveViewControllerCapabilityAgentTest  ,
test_givenInvalidParameters_create_shouldFail   
)

Test that create() returns a nullptr if called with invalid arguments.

◆ TEST_F() [2/5]

alexaClientSDK::alexaLiveViewController::test::TEST_F ( AlexaLiveViewControllerCapabilityAgentTest  ,
test_liveViewDirectives_successCase   
)

Test successful handling of StartLiveView and StopLiveView directives.

◆ TEST_F() [3/5]

alexaClientSDK::alexaLiveViewController::test::TEST_F ( AlexaLiveViewControllerCapabilityAgentTest  ,
test_startLiveViewDirective_errorCase   
)

Test error path of StartLiveView directive.

◆ TEST_F() [4/5]

alexaClientSDK::alexaLiveViewController::test::TEST_F ( AlexaLiveViewControllerCapabilityAgentTest  ,
test_stopLiveViewDirective_errorCase   
)

Test error path of StopLiveView directive.

◆ TEST_F() [5/5]

alexaClientSDK::alexaLiveViewController::test::TEST_F ( AlexaLiveViewControllerCapabilityAgentTest  ,
test_unknownDirective   
)

Tests unknown Directive. Expect that the sendExceptionEncountered and setFailed will be called.

◆ TIMEOUT()

static std::chrono::milliseconds alexaClientSDK::alexaLiveViewController::test::TIMEOUT ( 1000  )
static

Timeout when waiting for futures to be set.

◆ verifySendMessage()

static void alexaClientSDK::alexaLiveViewController::test::verifySendMessage ( std::shared_ptr< avsCommon::avs::MessageRequest request,
const std::string  expectedEventName,
const std::string  expectedPayload,
const std::string  expectedNameSpace 
)
static

Verify the request sent to AVS is as expected.

Parameters
requestRequest for the event that is being sent to the cloud.
expectedEventNameName of the event being sent.
expectedPayloadPayload of the event being sent.
expectedNameSpaceNamespace of the event being sent.

Variable Documentation

◆ EXPECTED_LIVE_VIEW_STARTED_PAYLOAD

const std::string alexaClientSDK::alexaLiveViewController::test::EXPECTED_LIVE_VIEW_STARTED_PAYLOAD
static
Initial value:
=
R"({"sessionId":"session_id","target":{"endpointId":"endpoint_id of the viewing device","type":"ALEXA_ENDPOINT"}})"

Expected LiveViewStarted payload for test purposes.

◆ EXPECTED_LIVE_VIEW_STOPPED_PAYLOAD

const std::string alexaClientSDK::alexaLiveViewController::test::EXPECTED_LIVE_VIEW_STOPPED_PAYLOAD
static
Initial value:
=
R"({"sessionId":"session_id","target":{"endpointId":"endpoint_id of the viewing device","type":"ALEXA_ENDPOINT"}})"

Expected LiveViewStopped payload for test purposes.

◆ INTERFACE_VERSION

const std::string alexaClientSDK::alexaLiveViewController::test::INTERFACE_VERSION {"1.7"}
static

The supported version.

◆ LIVE_VIEW_STARTED_EVENT

const std::string alexaClientSDK::alexaLiveViewController::test::LIVE_VIEW_STARTED_EVENT {"LiveViewStarted"}
static

The LiveViewStarted event signature.

◆ LIVE_VIEW_STOPPED_EVENT

const std::string alexaClientSDK::alexaLiveViewController::test::LIVE_VIEW_STOPPED_EVENT {"LiveViewStopped"}
static

The LiveViewStopped event signature.

◆ MESSAGE_EVENT_KEY

const std::string alexaClientSDK::alexaLiveViewController::test::MESSAGE_EVENT_KEY = "event"
static

JSON key for the event section of a message.

◆ MESSAGE_HEADER_KEY

const std::string alexaClientSDK::alexaLiveViewController::test::MESSAGE_HEADER_KEY = "header"
static

JSON key for the header section of a message.

◆ MESSAGE_NAME_KEY

const std::string alexaClientSDK::alexaLiveViewController::test::MESSAGE_NAME_KEY = "name"
static

JSON key for the name field of a message header.

◆ MESSAGE_NAMESPACE_KEY

const std::string alexaClientSDK::alexaLiveViewController::test::MESSAGE_NAMESPACE_KEY = "namespace"
static

JSON key for the namespace field of a message header.

◆ MESSAGE_PAYLOAD_KEY

const std::string alexaClientSDK::alexaLiveViewController::test::MESSAGE_PAYLOAD_KEY = "payload"
static

JSON key for the payload section of an message.

◆ NAME_STARTLIVEVIEW

const std::string alexaClientSDK::alexaLiveViewController::test::NAME_STARTLIVEVIEW {"StartLiveView"}
static

The name for StartLiveView directive.

◆ NAME_STOPLIVEVIEW

const std::string alexaClientSDK::alexaLiveViewController::test::NAME_STOPLIVEVIEW {"StopLiveView"}
static

The name for StopLiveView directive.

◆ NAMESPACE

const std::string alexaClientSDK::alexaLiveViewController::test::NAMESPACE {"Alexa.Camera.LiveViewController"}
static

The namespace for capability agent.

◆ START_LIVE_VIEW_PAYLOAD

const std::string alexaClientSDK::alexaLiveViewController::test::START_LIVE_VIEW_PAYLOAD
static

Sample StartLiveView payload.

◆ STOP_LIVE_VIEW_PAYLOAD

const std::string alexaClientSDK::alexaLiveViewController::test::STOP_LIVE_VIEW_PAYLOAD
static
Initial value:
= R"(
{
"sessionId" : "session_id",
"target" : {
"type" : "ALEXA_ENDPOINT",
"endpointId" : "endpoint_id of the viewing device"
}
})"

Sample StopLiveView payload.

◆ UNKNOWN_DIRECTIVE

const std::string alexaClientSDK::alexaLiveViewController::test::UNKNOWN_DIRECTIVE {"Unknown"}
static

An unknown directive signature.

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0