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

Classes

class  CapabilitiesDelegateTest
 
class  DiscoveryEventSenderTest
 
struct  EventData
 
class  MockAuthDelegate
 
class  MockCapabilitiesDelegateObserver
 
class  MockCapabilitiesDelegateStorage
 
class  MockDiscoveryEventSender
 
class  MockDiscoveryStatusObserver
 
class  PostConnectCapabilitiesPublisherTest
 

Functions

AVSDiscoveryEndpointAttributes createEndpointAttributes (const std::string endpointId="TEST_ENDPOINT_ID")
 
AVSDiscoveryEndpointAttributes::Registration createEndpointRegistration (const std::string productID=TEST_PRODUCT_ID, const std::string serialNumber=TEST_SERIAL_NUMBER, const std::string registrationKey=TEST_REGISTRATION_KEY, const std::string productIdKey=TEST_PRODUCT_ID_KEY)
 
CapabilityConfiguration createCapabilityConfiguration (const CapabilityConfiguration::AdditionalConfigurations &additionalConfigurationsIn=CapabilityConfiguration::AdditionalConfigurations())
 
 TEST_F (CapabilitiesDelegateTest, test_createMethodWithInvalidParameters)
 
 TEST_F (CapabilitiesDelegateTest, test_init)
 
 TEST_F (CapabilitiesDelegateTest, test_invalidateCapabilities)
 
 TEST_F (CapabilitiesDelegateTest, test_clearData)
 
 TEST_F (CapabilitiesDelegateTest, test_shutdown)
 
 TEST_F (CapabilitiesDelegateTest, test_addCapabilitiesObserver)
 
 TEST_F (CapabilitiesDelegateTest, test_onDiscoveryCompleted)
 
 TEST_F (CapabilitiesDelegateTest, test_onDiscoveryCompletedButStorageFails)
 
 TEST_F (CapabilitiesDelegateTest, test_onDiscoveryFailure)
 
 TEST_F (CapabilitiesDelegateTest, test_addOrUpdateEndpointReturnsFalseWithInvalidInput)
 
 TEST_F (CapabilitiesDelegateTest, test_dynamicAddOrUpdateEndpoint)
 
 TEST_F (CapabilitiesDelegateTest, test_deleteEndpointReturnsFalseWithInvalidInput)
 
 TEST_F (CapabilitiesDelegateTest, test_dynamicDeleteEndpoint)
 
 TEST_F (CapabilitiesDelegateTest, test_dynamicDeleteEndpointWhenEndpointNotRegisteredShouldFail)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationWithDifferentEndpointConfigs)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationWithPendingEndpointsWithSameEndpointConfigs)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationWithoutPendingEndpointsAndSameEndpointConfigs)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationCachesEndpoints)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationWithStaleEndpointAndWithoutPendingEndpointsAndSameEndpointConfigs)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationWithStaleEndpoint)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationWithStaleEndpointAndPendingEndpointsWithSameEndpointConfigs)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationWithNewEndpointAndPendingEndpointsWithSameEndpointConfigs)
 
 TEST_F (CapabilitiesDelegateTest, test_createTwoPostConnectOperationWithStaleEndpointAndPendingEndpointsWithSameEndpointConfigs)
 
 TEST_F (CapabilitiesDelegateTest, test_createPostConnectOperationWithReconnects)
 
 TEST_F (CapabilitiesDelegateTest, test_setDiscoveryEventSenderStopsPreviousDiscoveryEventSender)
 
 TEST_F (CapabilitiesDelegateTest, test_onAVSGatewayChangedNotification)
 
 TEST_F (CapabilitiesDelegateTest, test_reconnectWhenStorageIsEmpty)
 
 TEST_F (CapabilitiesDelegateTest, test_deferSendDiscoveryEventsWhileDiscoveryEventSenderInFlight)
 
 TEST_F (CapabilitiesDelegateTest, test_observerCallingIntoCapabilitiesDelegateOnSuccessNotificationSucceeds)
 
 TEST_F (CapabilitiesDelegateTest, test_doNotSendEndpointsWhileDisconnected)
 
 TEST_F (CapabilitiesDelegateTest, test_reconnectTriggersSendPendingEndpoints)
 
 TEST_F (CapabilitiesDelegateTest, test_duplicateEndpointInPendingAddOrUpdateAndDeleteShouldFail)
 
 TEST_F (CapabilitiesDelegateTest, test_registration)
 
 TEST_F (CapabilitiesDelegateTest, test_addAndUpdateOfDeduplicatedEndpoints)
 
 TEST_F (CapabilitiesDelegateTest, test_deduplictedDeletionFailure)
 
 TEST_F (CapabilitiesDelegateTest, test_SplitMessagePendingDeduplicatedEndpoints)
 
 TEST_F (CapabilitiesDelegateTest, test_endpointLimits)
 
 TEST_F (CapabilitiesDelegateTest, test_updateDeduplicatedEndpointWhenInflight)
 
 TEST_F (CapabilitiesDelegateTest, test_addDeduplicatedEndpointWhenOtherInflight)
 
bool parseAuthToken (const std::string &payloadString, EventData *eventData)
 
bool parseEndpointsIds (const std::string &payloadString, EventData *eventData)
 
bool parseEventJson (const std::string &eventJson, EventData *eventData)
 
void validateDiscoveryEvent (const EventData &eventData, const std::string &eventName, const std::vector< std::string > &endpointIds=std::vector< std::string >())
 
 TEST_F (DiscoveryEventSenderTest, test_createWithInvalidParams)
 
 TEST_F (DiscoveryEventSenderTest, test_sendsDiscoveryEvents)
 
 TEST_F (DiscoveryEventSenderTest, test_sendsDiscoveryEventsNotWaitForEventProcessed)
 
 TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsFailsWithNullMessageSender)
 
static int getExpectedNumberOfDiscoveryEventsFromEndpointNum (int numEndpoints)
 
static int getExpectedNumberOfDiscoveryEventFromPayloadSize (int endpointPayloadSize)
 
 TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsSplitsEventsWithMaxEndpoints)
 
 TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsSplitsEventsWhenMaxPayloadSizeIsReached)
 
 TEST_F (DiscoveryEventSenderTest, test_deleteReportEventReceives4xxResponse)
 
 TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsWhenAuthTokenIsEmpty)
 
 TEST_F (DiscoveryEventSenderTest, test_addOrUpdateReportReceives4xxResponse)
 
 TEST_F (DiscoveryEventSenderTest, test_retriesWhenAddOrUpdateReportReceives5xxResponse)
 
 TEST_F (DiscoveryEventSenderTest, test_addOrUpdateRetriesThenSuccessfulResponse)
 
 TEST_F (DiscoveryEventSenderTest, test_deleteReportRetriesThenSuccessfulResponse)
 
 TEST_F (DiscoveryEventSenderTest, test_retriesWhenEventProcessedDirectiveIsNotReceived)
 
 TEST_F (DiscoveryEventSenderTest, test_retriesWhenInvalidEventProcessedDirectiveIsReceived)
 
 TEST_F (DiscoveryEventSenderTest, test_stopWhenWaitingOnEventProcessedDirective)
 
 TEST_F (DiscoveryEventSenderTest, test_stopWhenAuthTokenIsRequested)
 
 TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsFailsWhenCalledTwice)
 
 TEST_F (PostConnectCapabilitiesPublisherTest, test_createWithInvalidParams)
 
 TEST_F (PostConnectCapabilitiesPublisherTest, test_getPostConnectOperationPriority)
 
 TEST_F (PostConnectCapabilitiesPublisherTest, test_performOperationWithInvalidPostConnectSender)
 
 TEST_F (PostConnectCapabilitiesPublisherTest, test_performOperationSendsDiscoveryEvents)
 
 TEST_F (PostConnectCapabilitiesPublisherTest, test_performOperationFailsWhenCalledTwice)
 
 TEST_F (PostConnectCapabilitiesPublisherTest, test_performOperationFailsWhenSendDiscoveryEventsFails)
 
 TEST_F (PostConnectCapabilitiesPublisherTest, test_abortStopsSendDiscoveryEvents)
 

Variables

static const std::string TEST_AUTH_TOKEN = "TEST_AUTH_TOKEN"
 Test string for auth token. More...
 
static const std::string EVENT_KEY = "event"
 The event key in the discovery event. More...
 
static const std::string HEADER_KEY = "header"
 The header key in the discovery event. More...
 
static const std::string EVENT_CORRELATION_TOKEN_KEY = "eventCorrelationToken"
 The eventCorrelationToken key in the discovery event. More...
 
static const std::chrono::seconds MY_WAIT_TIMEOUT {5}
 
static const std::string TEST_CLIENT_ID = "TEST_CLIENT_ID"
 A Test client Id. More...
 
static const std::string TEST_PRODUCT_ID = "TEST_PRODUCT_ID"
 A Test product Id. More...
 
static const std::string TEST_SERIAL_NUMBER = "TEST_SERIAL_NUMBER"
 A Test serial number. More...
 
static const std::string TEST_REGISTRATION_KEY = "TEST_REGISTRATION_KEY"
 A Test product Id. More...
 
static const std::string TEST_PRODUCT_ID_KEY = "TEST_PRODUCT_ID_KEY"
 A Test product Id Key. More...
 
static const std::string TEST_MANUFACTURER_NAME = "TEST_MANUFACTURER_NAME"
 A Test manufacturer name. More...
 
static const std::string TEST_DESCRIPTION = "TEST_DESCRIPTION"
 A Test description. More...
 
static const std::string TEST_DISPLAY_CATEGORY = "TEST_DISPLAY_CATEGORY"
 A Test display category. More...
 
static const std::string DISCOVERY_NAMESPACE = "Alexa.Discovery"
 The Discovery event Namsepace. More...
 
static const std::string ADD_OR_UPDATE_REPORT_NAME = "AddOrUpdateReport"
 The AddOrUpdateReport Namespace. More...
 
static const std::string DELETE_REPORT_NAME = "DeleteReport"
 The DeleteReport Namespace. More...
 
static const std::string DISCOVERY_PAYLOAD_VERSION = "3"
 The payload version of the discovery event. More...
 
static const std::string ENDPOINTS_KEY = "endpoints"
 The scope key in the discovery event. More...
 
static const std::string ENDPOINTID_KEY = "endpointId"
 The scope key in the discovery event. More...
 
static const std::string EVENT_KEY = "event"
 The event key in the discovery event. More...
 
static const std::string HEADER_KEY = "header"
 The header key in the discovery event. More...
 
static const std::string NAMESPACE_KEY = "namespace"
 The namespace key in the discovery event. More...
 
static const std::string NAME_KEY = "name"
 The name key in the discovery event. More...
 
static const std::string PAYLOAD_VERSION_KEY = "payloadVersion"
 The payload version key in the discovery event. More...
 
static const std::string EVENT_CORRELATION_TOKEN_KEY = "eventCorrelationToken"
 The eventCorrelationToken key in the discovery event. More...
 
static const std::string PAYLOAD_KEY = "payload"
 The payload key in the discovery event. More...
 
static const std::string TEST_AUTH_TOKEN = "TEST_AUTH_TOKEN"
 Test string for auth token. More...
 
static const std::string TEST_ENDPOINT_ID_1 = "1"
 Test string for endpointID 1. More...
 
static const std::string TEST_ENDPOINT_ID_2 = "2"
 Test string for endpointId 2. More...
 
static const std::unordered_map< std::string, std::string > TEST_ADD_OR_UPDATE_ENDPOINTS
 The test endpointId to endpointConfig map AddOrUpdateReport event endpoints. More...
 
static const std::unordered_map< std::string, std::string > TEST_DELETE_ENDPOINTS
 The test endpointId to endpointConfig map DeleteReport event endpoints. More...
 
static const std::vector< std::string > EXPECTED_ADD_OR_UPDATE_ENDPOINT_IDS = {TEST_ENDPOINT_ID_1}
 The expected AddOrUpdateReport endpoint Ids. More...
 
static const std::vector< std::string > EXPECTED_DELETE_ENDPOINT_IDS = {TEST_ENDPOINT_ID_2}
 The expected DeleteReport endpoint Ids. More...
 
static const std::string TEST_EVENT_CORRELATION_TOKEN = "TEST_EVENT_CORRELATION_TOKEN"
 The test string for eventCorrelationToken sent in headers. More...
 
static constexpr int TEST_RETRY_COUNT = 2
 The test retry count. More...
 
static constexpr int MAX_ENDPOINTS_PER_ADD_OR_UPDATE_REPORT_EVENT = 300
 Maximum number of endpoints that can be sent in a Discovery.AddOrUpdateReport event. More...
 
static constexpr int MAX_ENDPOINTS_SIZE_IN_PAYLOAD = 246 * 1024
 Maximum size of Discovery event (246KB) More...
 

Function Documentation

◆ createCapabilityConfiguration()

CapabilityConfiguration alexaClientSDK::capabilitiesDelegate::test::createCapabilityConfiguration ( const CapabilityConfiguration::AdditionalConfigurations additionalConfigurationsIn = CapabilityConfiguration::AdditionalConfigurations())

Creates a test CapabilityConfiguration.

Returns
a CapabilityConfiguration structure.

◆ createEndpointAttributes()

AVSDiscoveryEndpointAttributes alexaClientSDK::capabilitiesDelegate::test::createEndpointAttributes ( const std::string  endpointId = "TEST_ENDPOINT_ID")

Create a test AVSDiscoveryEndpointAttributes.

Parameters
endpointIdOptional endpointId to use in these attributes. Default "TEST_ENDPOINT_ID".
Returns
a AVSDiscoveryEndpointAttributes structure.

◆ createEndpointRegistration()

AVSDiscoveryEndpointAttributes::Registration alexaClientSDK::capabilitiesDelegate::test::createEndpointRegistration ( const std::string  productID = TEST_PRODUCT_ID,
const std::string  serialNumber = TEST_SERIAL_NUMBER,
const std::string  registrationKey = TEST_REGISTRATION_KEY,
const std::string  productIdKey = TEST_PRODUCT_ID_KEY 
)

Create a test AVSDiscoveryEndpointAttributes::Registration object.

Parameters
productIdOptional product Id to use in these attributes.
serialNumberOptional device serial number to use in these attributes.
registrationKeyOptional registration key to use in these attributes.
productIdKeyOptional product Id Key to use in these attributes.
Returns
a AVSDiscoveryEndpointAttributes::Registration structure.

◆ getExpectedNumberOfDiscoveryEventFromPayloadSize()

static int alexaClientSDK::capabilitiesDelegate::test::getExpectedNumberOfDiscoveryEventFromPayloadSize ( int  endpointPayloadSize)
inlinestatic

This method returns the number of Discovery Events the given endpoints will be spit into based on the endpoint payload size.

Parameters
endpointPayloadSizeThe total size of the endpoint payload.
Returns
The number of discovery events that need to be created.

◆ getExpectedNumberOfDiscoveryEventsFromEndpointNum()

static int alexaClientSDK::capabilitiesDelegate::test::getExpectedNumberOfDiscoveryEventsFromEndpointNum ( int  numEndpoints)
inlinestatic

This method returns the number of Discovery Events the given endpoints will be split into.

Parameters
numEndpointsThe total number of endpoints.
Returns
The number of discovery events these endpoints will be split into.

◆ parseAuthToken()

bool alexaClientSDK::capabilitiesDelegate::test::parseAuthToken ( const std::string &  payloadString,
EventData eventData 
)

Parses the auth token sent in the Discovery event and stores the data in the EventData structure.

Parameters
payloadStringThe payload of the discovery event.
eventDataThe pointer to the EventData structure.
Returns
True if parsing is successful, else false.

◆ parseEndpointsIds()

bool alexaClientSDK::capabilitiesDelegate::test::parseEndpointsIds ( const std::string &  payloadString,
EventData eventData 
)

Parses the event JSON and stores the data in the EventData structure.

Parameters
payloadStringThe payload string.
eventDataThe pointer to the EventData structure.
Returns
True if parsing is successful, else false.

◆ parseEventJson()

bool alexaClientSDK::capabilitiesDelegate::test::parseEventJson ( const std::string &  eventJson,
EventData eventData 
)

Parses the event JSON and stores the data in the EventData structure.

Parameters
eventJsonThe event data.
eventDataThe pointer to the EventData structure.
Returns
True if the parsing is successful, else false.

◆ TEST_F() [1/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( PostConnectCapabilitiesPublisherTest  ,
test_createWithInvalidParams   
)

Test create fails with invalid parameters.

◆ TEST_F() [2/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( PostConnectCapabilitiesPublisherTest  ,
test_getPostConnectOperationPriority   
)

Test getPriority method returns expected value.

◆ TEST_F() [3/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( PostConnectCapabilitiesPublisherTest  ,
test_performOperationWithInvalidPostConnectSender   
)

Test that performOperation fails if the PostConnectSendMessage is invalid.

◆ TEST_F() [4/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( PostConnectCapabilitiesPublisherTest  ,
test_performOperationSendsDiscoveryEvents   
)

Test performOperation sends Discovery events.

◆ TEST_F() [5/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( PostConnectCapabilitiesPublisherTest  ,
test_performOperationFailsWhenCalledTwice   
)

Test second call to performOperation fails when executed twice.

◆ TEST_F() [6/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( PostConnectCapabilitiesPublisherTest  ,
test_performOperationFailsWhenSendDiscoveryEventsFails   
)

Test when sending Discovery events fails.

◆ TEST_F() [7/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( PostConnectCapabilitiesPublisherTest  ,
test_abortStopsSendDiscoveryEvents   
)

Test abortOperation stops DiscoveryEventSender.

Stop is called on destruction as well as abort.

◆ TEST_F() [8/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createMethodWithInvalidParameters   
)

Tests the create method with various configurations.

◆ TEST_F() [9/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_createWithInvalidParams   
)

Test create fails with invalid parameters

◆ TEST_F() [10/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_init   
)

Tests the init method and if the open(), createDatabase() and load() methods get called on storage.

Test if creteDatabase fails create method return nullptr.

Happy path.

◆ TEST_F() [11/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_sendsDiscoveryEvents   
)

Test Happy Path, if AddOrUpdateReport event and DeleteReport event get sent out.

◆ TEST_F() [12/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_invalidateCapabilities   
)

Tests if the invalidateCapabilities method triggers a database cleanup.

◆ TEST_F() [13/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_clearData   
)

Tests if the clearData method triggers a database cleanup.

◆ TEST_F() [14/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_shutdown   
)

Test if the addDiscoveryObserver method gets triggered when the setDiscoveryEventSender method is called. Test if DiscoveryEventSender is stopped when the shutdown method is called. Test if the removeDiscoveryObserver method gets triggered when the shutdown method is called.

◆ TEST_F() [15/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_sendsDiscoveryEventsNotWaitForEventProcessed   
)

Test Happy Path, if AddOrUpdateReport event and DeleteReport event get sent out without wait for EventProcessed.

◆ TEST_F() [16/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_addCapabilitiesObserver   
)

Tests the addCapabilitiesObserver() method.

Adding null observer doesn't fail.

Add a new observer and it receives notifications of the current capabilities state.

Add existing observer and it does not get any notifications (strict mock would catch any extra notifications)

◆ TEST_F() [17/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_sendDiscoveryEventsFailsWithNullMessageSender   
)

Test sendDiscoveryEvents fails with null message sender.

◆ TEST_F() [18/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_onDiscoveryCompleted   
)

Tests for onDiscoveryCompleted() method.

Check if store and erase is triggered and if observer gets notified.

Check removing observer does not send notifications to the observer.

Only store and erase is triggered, observer does not get notified (should fail as we use strict mock for observer).

◆ TEST_F() [19/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_sendDiscoveryEventsSplitsEventsWithMaxEndpoints   
)

Test if multiple discovery events are sent if the number of endpoints is greater than MAX endpoints.

◆ TEST_F() [20/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_onDiscoveryCompletedButStorageFails   
)

Check onDiscoveryCompleted() but storage to device fails.

Check if store and erase is triggered and if observer gets notified.

◆ TEST_F() [21/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_onDiscoveryFailure   
)

Check notifications when onDiscoveryFailure() method is called.

validate retriable error response

validate invalid auth error response

validate bad request error response

other responses

◆ TEST_F() [22/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_sendDiscoveryEventsSplitsEventsWhenMaxPayloadSizeIsReached   
)

Test if multiple discovery events are sent if the max payload size is reached.

Create a large endpointConfig string (2KB)

◆ TEST_F() [23/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_addOrUpdateEndpointReturnsFalseWithInvalidInput   
)

Tests if addOrUpdateEndpoint returns false for invalid input.

Invalid AVSDiscoveryEndpointAttributes.

Empty Capabilities.

Invalid CapabilityConfiguration.

EndpointAttributes does not have endpointID which is required.

EndpointConfiguration too big

Return false if endpoint is a duplicate in pending list.

◆ TEST_F() [24/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_dynamicAddOrUpdateEndpoint   
)

Tests dynamic addOrUpdateEndpoint happy path.

Set-up.

Expect calls to MessageSender.

Expect call to storage.

Expect callback to CapabilitiesObserver.

◆ TEST_F() [25/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_deleteReportEventReceives4xxResponse   
)

Test when AddOrUpdateReport response is 202 and DeleteReport response is 4xx.

◆ TEST_F() [26/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_sendDiscoveryEventsWhenAuthTokenIsEmpty   
)

Test auth token is empty.

◆ TEST_F() [27/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_addOrUpdateReportReceives4xxResponse   
)

Test when AddOrUpdateReport response is 4xx, DeleteReport event is not sent.

◆ TEST_F() [28/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_deleteEndpointReturnsFalseWithInvalidInput   
)

Tests if deleteEndpoint returns false for invalid input.

Invalid AVSDiscoveryEndpointAttributes.

Empty Capabilities.

Invalid CapabilityConfiguration.

EndpointAttributes does not have endpointID which is required.

◆ TEST_F() [29/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_dynamicDeleteEndpoint   
)

Tests dynamic deleteEndpoint happy path.

Set-up.

Add endpoint (so we can delete it).

Expect calls to MessageSender.

Expect call to storage.

Expect callback to CapabilitiesObserver.

◆ TEST_F() [30/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_retriesWhenAddOrUpdateReportReceives5xxResponse   
)

Test when AddOrUpdateReport response is 5xx, there are retries and deleteReport is not sent.

wait until 3 retries and exit.

spin a thread to initiate abort.

◆ TEST_F() [31/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_addOrUpdateRetriesThenSuccessfulResponse   
)

Test when AddOrUpdateReport response is 5xx, there are retries. If its successful after two retries, deleteReport event also gets sent out.

◆ TEST_F() [32/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_dynamicDeleteEndpointWhenEndpointNotRegisteredShouldFail   
)

Tests dynamic deleteEndpoint should fail if endpoint is unregistered.

Set-up.

◆ TEST_F() [33/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationWithDifferentEndpointConfigs   
)

Endpoint config is different from the endpoint config created with the test endpoint attributes so a post connect operation is created.

◆ TEST_F() [34/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_deleteReportRetriesThenSuccessfulResponse   
)

Test when DeleteReport response is 5xx, there are retries. If its successful after two retries, Discovery is completed.

◆ TEST_F() [35/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationWithPendingEndpointsWithSameEndpointConfigs   
)

Tests if the createPostConnectOperation() does not create a new PostConnectCapabilitiesPublisher when registered pending endpoint configurations are same as the ones in storage. Tests if CapabilitiesDelegate reports this as a success to observers as there are pending endpoints.

Endpoint config is same as the endpoint config created with the test endpoint attributes so a post connect operation is not created. However, we do expect an observer callback as there were pending endpoints.

◆ TEST_F() [36/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_retriesWhenEventProcessedDirectiveIsNotReceived   
)

Test when EventProcessed directive is not received, the AddOrUpdateReport event is retried and deleteReport event does not get sent.

wait until 3 retries and exit.

spin a thread to initiate abort.

◆ TEST_F() [37/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationWithoutPendingEndpointsAndSameEndpointConfigs   
)

Tests if the createPostConnectOperation() does not create a new PostConnectCapabilitiesPublisher when registered pending endpoint configurations are same as the ones in storage. Tests that CapabilitiesDelegate does not notify observers on re-connect, as there were no changes and no pending endpoints expecting to be registered. This ensures observers are not notified unnecessarily during re-connects.

Set-up.

Add the endpoint here before creating the initial post-connect, which forces the endpoint to be cached in CapabilitiesDelegate. Here we do expect an observer callback because there is a pending endpoint. This is test set-up.s

Test.

Create another post-connect operation; this simulates the re-connect. There are no pending endpoints to send in CapabilitiesDelegate, and the cached endpoint in CapabilitiesDelegate matches what is stored in the database, so expect no observer callback as well as a null post connect operation. Strict mocks will catch the observer callback if it happens incorrectly.

Endpoint config is same as the endpoint config created with the test endpoint attributes so a post connect operation is not created.

◆ TEST_F() [38/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_retriesWhenInvalidEventProcessedDirectiveIsReceived   
)

Test when EventProcessed directive is received with a wrong event correlation token, the AddOrUpdateReport event is retried and deleteReport event does not get sent.

wait until 3 retries and exit.

spin a thread to initiate abort.

◆ TEST_F() [39/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_stopWhenWaitingOnEventProcessedDirective   
)

Test when stop gets called while waiting on the EventProcessed directive.

spin a thread to initiate abort.

◆ TEST_F() [40/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationCachesEndpoints   
)

Tests if the createPostConnectOperation() caches pending endpoints even when it does not create a new post-connect operation as capabilities have not change.

Returning a stored endpoint here is necessary to force CapabilitiesDelegate to cache the endpoint on the first call to createPostConnectOperation().

This represents an empty database, so that when createPostConnectOperation() is called a second time, we can verify that it creates a non-null post-connect publisher to send the cached endpoint.

Endpoint config is same as the endpoint config created with the test endpoint attributes so a post connect operation is not created, but we add the endpoint here so that it is cached in CapabilitiesDelegate for testing later. Expect an observer callback here, since there is a pending endpoint.

Test. Create another post-connect operation; this simulates a re-connect. We can verify whether the endpoint from the first createPostConnectOperation() was cached.

The database is empty, but because there should be a cached endpoint, we expect a non-null post-connect publisher to send that endpoint to AVS.

◆ TEST_F() [41/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_stopWhenAuthTokenIsRequested   
)

Test stop when requesting auth token.

Since the state is uninitialized performOperation() will be waiting in getAuthToken() method.

give a short time

spin a thread to initiate abort.

◆ TEST_F() [42/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( DiscoveryEventSenderTest  ,
test_sendDiscoveryEventsFailsWhenCalledTwice   
)

Test second call to sendDiscoveryEvents fails when executed twice.

◆ TEST_F() [43/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationWithStaleEndpointAndWithoutPendingEndpointsAndSameEndpointConfigs   
)

Tests if the createPostConnectOperation() creates a new PostConnectCapabilitiesPublisher when registered endpoint configurations are same as the ones in storage, but there is one additional stored endpoint that is not registered (and needs to be deleted). Tests observers are NOT notified of added endpoints since there are no pending endpoints.s Tests if CapabilitiesDelegate returns a non-null post connect operation, since there is a stale endpoint to delete.

Stale endpoint is in the database but not registered.

Endpoint config is same as the endpoint config created with the test endpoint attributes so a post connect operation is not created, but add it here so that it is cached in CapabilitiesDelegate.

Create another post-connect operation; this simulates a re-connect. There is a stale endpoint to be sent, so we expect a non-null post connect publisher. However, there is no pending endpoint to register, so we expect no immediate observer notification.

Endpoint config is same as the endpoint config created with the test endpoint attributes so a post connect operation is not created.

◆ TEST_F() [44/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationWithStaleEndpoint   
)

Tests if the createPostConnectOperation() creates a new PostConnectCapabilitiesPublisher when there is an endpoint in storage that is not registered (that is, a stale endpoint in the database). Tests if CapabilitiesDelegate returns a non-null post connect operation, since there is a stale endpoint to delete.

There is a stale endpoint to be deleted, so we expect a non-null post connect publisher.

Endpoint config is same as the endpoint config created with the test endpoint attributes so a post connect operation is not created.

◆ TEST_F() [45/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationWithStaleEndpointAndPendingEndpointsWithSameEndpointConfigs   
)

Tests if the createPostConnectOperation() creates a new PostConnectCapabilitiesPublisher when registered endpoint configurations are same as the ones in storage, but there is one additional stored endpoint that is not registered (and needs to be deleted). Tests CapabilitiesObservers are notified of added endpoints even though they were not published in an event. Tests if CapabilitiesDelegate returns a non-null post connect operation, since there is a stale endpoint to delete.

Observer callback should only contain the pending endpoint to add (since that is already registered), but not the stale endpoint to delete (since that still needs to be sent to AVS).

◆ TEST_F() [46/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationWithNewEndpointAndPendingEndpointsWithSameEndpointConfigs   
)

Tests if the createPostConnectOperation() creates a new PostConnectCapabilitiesPublisher when registered endpoint configurations are same as the ones in storage, but there is one additional stored endpoint that is not registered (and needs to be deleted). Tests CapabilitiesObservers are notified of added endpoints even though they were not published in an event. Tests if CapabilitiesDelegate returns a non-null post connect operation, since there is a stale endpoint to delete.

Observer callback should only contain the pending endpoint to add (since that is already registered), but not the stale endpoint to delete (since that still needs to be sent to AVS).

◆ TEST_F() [47/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createTwoPostConnectOperationWithStaleEndpointAndPendingEndpointsWithSameEndpointConfigs   
)

Tests if before the stale endpoint is deleted and the stale endpoint is added, that the first createPostConnectOperation will create a deleteReport for the stale endpoint, but the second createPostConnectOperation will return a nullptr operation because the stale endpoint has been added, and this results in no change in capabilities.

Observer callback should only contain the pending endpoint to add (since that is already registered), but not the stale endpoint to delete (since that still needs to be sent to AVS).

◆ TEST_F() [48/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_createPostConnectOperationWithReconnects   
)

Tests if the createPostConnectOperation() creates a new PostConnectCapabilitiesPublisher when storage is empty. When the capabilities are successfully published, a subsequent call to createPostConnectOperation() results in a nullptr.

Note
This test simulates a fresh device which sends a successful Discovery event followed by a reconnection. Since the discovery event is already sent and the result is stored in the database, a new post connect capabilities publisher is not created on reconnection.

Endpoint config in storage is empty, create a new post connect operation.

Expect the successfully published endpoint configuration to be stored and erase.

Notify that discovery has successfully completed.

Expect call to load endpoint configuration

PostConnectOperation after reconnection

◆ TEST_F() [49/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_setDiscoveryEventSenderStopsPreviousDiscoveryEventSender   
)

Tests if setDiscoveryEventSender always stops the previous DiscoveryEventSender. This is critical because even though an individual DiscoveryEventSender contains exponential backoff and timeout logic to avoid spamming the backend service, if many DiscoveryEventSender objects are created (e.g. in a re-connect loop with many post-connect operations) and any of these are failed to be stopped before creating the next one, there is a real risk of throttling.

This test creates and adds many DiscoveryEventSenders asynchronously. We verify that every DiscoveryEventSender is stopped.

Set up the CapabilitiesDelegate.

Create the mock DiscoveryEventSenders.

The last DES to be added will only have stop() called on it in CapabilitiesDelegate's own shutdown method. Non-mock DiscoveryEventSenders also call stop() on themselves in their own dtor, but that is not the case here as we're using mocks.

Spin up the threads that will all call setDiscoveryEventSender(...).

Wait for the threads.

◆ TEST_F() [50/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_onAVSGatewayChangedNotification   
)

Test if the CapabilitiesDelegate calls the clearDatabase() method when the onAVSGatewayChanged() method is called.

◆ TEST_F() [51/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_reconnectWhenStorageIsEmpty   
)

Test if post-connect operation will send all registered and pending endpoints if database is empty (eg after onAVSGatewayChanged). Test if pending delete for a registered endpoint will mean that endpoint is not sent in addOrUpdateReport.

Set-up.

Add a test endpoint.

Add another test endpoint.

Add a third test endpoint. Get the capability json to test pending delete.

Expect calls to MessageSender.

Expect calls to storage.

Expect calls to CapabilitiesObserver.

Disconnect to force a pending delete.

Test post-connect with an empty database.

◆ TEST_F() [52/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_deferSendDiscoveryEventsWhileDiscoveryEventSenderInFlight   
)

Test if the CapabilitiesDelegate defers dynamically adding or deleting endpoints while there is a Discovery event in-flight.

Set-up.

Add a second test endpoint. Get the capability json for the last endpoint to test pending delete.

Add a DiscoveryEventSender to simulate Discovery event in-flight.

Expect no callback to CapabilitiesObserver, since these endpoints remain in pending.

◆ TEST_F() [53/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_observerCallingIntoCapabilitiesDelegateOnSuccessNotificationSucceeds   
)

Tests that CapabilitiesDelegate is in the correct state before notifying its observers.

Set-up.

Add an endpoint.

On the first successful capabilities change, call from observer back into CapabilitiesDelegate.

If the below is false with "endpoint not registered", this means that the CapabilitiesDelegate state is not correct when it notifies its observers.

◆ TEST_F() [54/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_doNotSendEndpointsWhileDisconnected   
)

Test if pending endpoints are not sent while disconnected.

Set-up.

Strict mock will catch unexpected calls.

◆ TEST_F() [55/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_reconnectTriggersSendPendingEndpoints   
)

Test if pending endpoints are sent on re-connect.

Set-up.

Add a third test endpoint. Get the capability json for the last endpoint to test pending delete.

Expect calls to MessageSender.

Expect calls to storage.

Expect calls to CapabilitiesObserver.

Test.

◆ TEST_F() [56/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_duplicateEndpointInPendingAddOrUpdateAndDeleteShouldFail   
)

Test if trying to delete an endpoint that is pending in addOrUpdate (and vice versa) results in failure.

Set-up.

Add an endpoint now so we can test pending delete.

Disconnect to force all endpoints into pending.

◆ TEST_F() [57/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_registration   
)

Test endpoint registrations. Confirm that changing the registration of an endpoint results in a failure. Also confirm that adding an endpoint with a different registration results in a failure.

Configure endpointId1 attributes with a non-empty registration.

Try endpointId1 with empty registration.

Configure endpointId2 attributes with a non-empty registration.

Try endpointId2 with non-empty registration.

Try endpointId3 with different and non-empty registration.

◆ TEST_F() [58/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_addAndUpdateOfDeduplicatedEndpoints   
)

Test adding 3 endpoints that share registration information (i.e. they are de-duplicated in the cloud). Verify that other endpoints are sent in the discovery message whenever an endpoint is added. Finally, update the first endpoint that was sent and confirm that all endpoints are sent in the discovery message.

Set-up.

endpointId1 is being registered first. The Discovery message should only contain it. Expect calls to MessageSender.

Expect call to storage.

Expect callback to CapabilitiesObserver.

endpointId1 has already been registered. Confirm that it is added when endpointId2 is added. Expect calls to MessageSender.

Expect call to storage.

Expect callback to CapabilitiesObserver.

endpointId1 and endpointId2 have already been registered. Confirm that they are added when endpointId3 is added. Expect calls to MessageSender.

Expect call to storage.

Expect callback to CapabilitiesObserver.

Update the configuration

endpointId1, endpointId2 and endpointId3 have already been registered. Confirm that they are added when endpointId1 is updated. Expect calls to MessageSender.

Expect call to storage.

Expect callback to CapabilitiesObserver.

◆ TEST_F() [59/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_deduplictedDeletionFailure   
)

Test that deleting a de-duplicated endpoint fails.

endpointId1 is being registered first. The Discovery message should only contain it. Expect calls to MessageSender.

Expect call to storage.

Expect callback to CapabilitiesObserver.

Deleting endpoint 1 should fail.

◆ TEST_F() [60/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_SplitMessagePendingDeduplicatedEndpoints   
)

Test adding two pairs of 3 endpoints that share registration information (i.e. they are de-duplicated in the cloud). For this test, endpointid3 and endpointId6 have large configurations, preventing them from being sent in the same message. Verify that the endpoints are split into two messages, each containing 3 endpoints.

Set-up the first set of deduplicated endpoints.

Set-up the second set of endpoints.

Create a large capability configuration for endpoint3 and endpoint6.

Create a default capability configuration for the other endpoints.

Upon connect, expect two messages to be sent. One with endpoints 1,2 and 3, and the other with endpoints 4, 5 and 6. Expect calls to MessageSender.

Expect call to storage.

Expect callback to CapabilitiesObserver.

◆ TEST_F() [61/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_endpointLimits   
)

Test limits of the Alexa.Discovery interface. Specifically test :

  1. Adding more than 300 deduplicated endpoints triggers a failure.
  2. Having more than 100 capabilities per deduplicated endpoint triggers a failure. This is because a single discovery message cannot contain more than 300 endpoints, per the limits imposed here: https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-discovery.html#limits

Add a deduplicated endpoint with more than MAX_CAPABILITIES_PER_ENDPOINT capabilities.

◆ TEST_F() [62/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_updateDeduplicatedEndpointWhenInflight   
)

Test updating a deduplicated endpoint when it is in flight.

Set-up.

Add a DiscoveryEventSender to simulate Discovery event in-flight.

Create an updated capability configuration for the update to endpoint1.

Expect no callback to CapabilitiesObserver, since the update remains in pending.

endpointId1 is inflight. Should be able to add it again to the pending update set.

◆ TEST_F() [63/63]

alexaClientSDK::capabilitiesDelegate::test::TEST_F ( CapabilitiesDelegateTest  ,
test_addDeduplicatedEndpointWhenOtherInflight   
)

Test adding a deduplicated endpoint when another one is in flight. Verify that the first endpoint is also sent in the discovery message when the second endpoint is added.

Set-up.

Add a DiscoveryEventSender to simulate Discovery event in-flight.

Expect no callback to CapabilitiesObserver, since the add of endpoint2 remains in pending.

Endpoint1 is in flight. Confirm that Endpoint2 is added to the pending endpoints.

◆ validateDiscoveryEvent()

void alexaClientSDK::capabilitiesDelegate::test::validateDiscoveryEvent ( const EventData eventData,
const std::string &  eventName,
const std::vector< std::string > &  endpointIds = std::vector<std::string>() 
)

Validates if the event data structure contains expected discovery event fields.

Parameters
eventDataThe EventData containing the parsed discovery fields
eventNameThe name of the discovery event to validate against.
endpointIdsThe optional endpointIds list to be validated against the payload.

Variable Documentation

◆ ADD_OR_UPDATE_REPORT_NAME

const std::string alexaClientSDK::capabilitiesDelegate::test::ADD_OR_UPDATE_REPORT_NAME = "AddOrUpdateReport"
static

The AddOrUpdateReport Namespace.

◆ DELETE_REPORT_NAME

const std::string alexaClientSDK::capabilitiesDelegate::test::DELETE_REPORT_NAME = "DeleteReport"
static

The DeleteReport Namespace.

◆ DISCOVERY_NAMESPACE

const std::string alexaClientSDK::capabilitiesDelegate::test::DISCOVERY_NAMESPACE = "Alexa.Discovery"
static

The Discovery event Namsepace.

◆ DISCOVERY_PAYLOAD_VERSION

const std::string alexaClientSDK::capabilitiesDelegate::test::DISCOVERY_PAYLOAD_VERSION = "3"
static

The payload version of the discovery event.

◆ ENDPOINTID_KEY

const std::string alexaClientSDK::capabilitiesDelegate::test::ENDPOINTID_KEY = "endpointId"
static

The scope key in the discovery event.

◆ ENDPOINTS_KEY

const std::string alexaClientSDK::capabilitiesDelegate::test::ENDPOINTS_KEY = "endpoints"
static

The scope key in the discovery event.

◆ EVENT_CORRELATION_TOKEN_KEY [1/2]

const std::string alexaClientSDK::capabilitiesDelegate::test::EVENT_CORRELATION_TOKEN_KEY = "eventCorrelationToken"
static

The eventCorrelationToken key in the discovery event.

◆ EVENT_CORRELATION_TOKEN_KEY [2/2]

const std::string alexaClientSDK::capabilitiesDelegate::test::EVENT_CORRELATION_TOKEN_KEY = "eventCorrelationToken"
static

The eventCorrelationToken key in the discovery event.

◆ EVENT_KEY [1/2]

const std::string alexaClientSDK::capabilitiesDelegate::test::EVENT_KEY = "event"
static

The event key in the discovery event.

◆ EVENT_KEY [2/2]

const std::string alexaClientSDK::capabilitiesDelegate::test::EVENT_KEY = "event"
static

The event key in the discovery event.

◆ EXPECTED_ADD_OR_UPDATE_ENDPOINT_IDS

const std::vector<std::string> alexaClientSDK::capabilitiesDelegate::test::EXPECTED_ADD_OR_UPDATE_ENDPOINT_IDS = {TEST_ENDPOINT_ID_1}
static

The expected AddOrUpdateReport endpoint Ids.

◆ EXPECTED_DELETE_ENDPOINT_IDS

const std::vector<std::string> alexaClientSDK::capabilitiesDelegate::test::EXPECTED_DELETE_ENDPOINT_IDS = {TEST_ENDPOINT_ID_2}
static

The expected DeleteReport endpoint Ids.

◆ HEADER_KEY [1/2]

const std::string alexaClientSDK::capabilitiesDelegate::test::HEADER_KEY = "header"
static

The header key in the discovery event.

◆ HEADER_KEY [2/2]

const std::string alexaClientSDK::capabilitiesDelegate::test::HEADER_KEY = "header"
static

The header key in the discovery event.

◆ MAX_ENDPOINTS_PER_ADD_OR_UPDATE_REPORT_EVENT

constexpr int alexaClientSDK::capabilitiesDelegate::test::MAX_ENDPOINTS_PER_ADD_OR_UPDATE_REPORT_EVENT = 300
static

Maximum number of endpoints that can be sent in a Discovery.AddOrUpdateReport event.

◆ MAX_ENDPOINTS_SIZE_IN_PAYLOAD

constexpr int alexaClientSDK::capabilitiesDelegate::test::MAX_ENDPOINTS_SIZE_IN_PAYLOAD = 246 * 1024
static

Maximum size of Discovery event (246KB)

◆ MY_WAIT_TIMEOUT

const std::chrono::seconds alexaClientSDK::capabilitiesDelegate::test::MY_WAIT_TIMEOUT {5}
static

Constant representing the timeout for test events.

Note
Use a large enough value that should not fail even in slower systems.

◆ NAME_KEY

const std::string alexaClientSDK::capabilitiesDelegate::test::NAME_KEY = "name"
static

The name key in the discovery event.

◆ NAMESPACE_KEY

const std::string alexaClientSDK::capabilitiesDelegate::test::NAMESPACE_KEY = "namespace"
static

The namespace key in the discovery event.

◆ PAYLOAD_KEY

const std::string alexaClientSDK::capabilitiesDelegate::test::PAYLOAD_KEY = "payload"
static

The payload key in the discovery event.

◆ PAYLOAD_VERSION_KEY

const std::string alexaClientSDK::capabilitiesDelegate::test::PAYLOAD_VERSION_KEY = "payloadVersion"
static

The payload version key in the discovery event.

◆ TEST_ADD_OR_UPDATE_ENDPOINTS

const std::unordered_map<std::string, std::string> alexaClientSDK::capabilitiesDelegate::test::TEST_ADD_OR_UPDATE_ENDPOINTS
static
Initial value:
= {
{TEST_ENDPOINT_ID_1, R"({"endpointId":")" + TEST_ENDPOINT_ID_1 + R"("})"}}
static const std::string TEST_ENDPOINT_ID_1
Test string for endpointID 1.
Definition: DiscoveryEventSenderTest.cpp:67

The test endpointId to endpointConfig map AddOrUpdateReport event endpoints.

◆ TEST_AUTH_TOKEN [1/2]

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_AUTH_TOKEN = "TEST_AUTH_TOKEN"
static

Test string for auth token.

◆ TEST_AUTH_TOKEN [2/2]

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_AUTH_TOKEN = "TEST_AUTH_TOKEN"
static

Test string for auth token.

◆ TEST_CLIENT_ID

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_CLIENT_ID = "TEST_CLIENT_ID"
static

A Test client Id.

◆ TEST_DELETE_ENDPOINTS

const std::unordered_map<std::string, std::string> alexaClientSDK::capabilitiesDelegate::test::TEST_DELETE_ENDPOINTS
static
Initial value:
= {
{TEST_ENDPOINT_ID_2, R"({"endpointId":")" + TEST_ENDPOINT_ID_2 + R"("})"}}
static const std::string TEST_ENDPOINT_ID_2
Test string for endpointId 2.
Definition: DiscoveryEventSenderTest.cpp:69

The test endpointId to endpointConfig map DeleteReport event endpoints.

◆ TEST_DESCRIPTION

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_DESCRIPTION = "TEST_DESCRIPTION"
static

A Test description.

◆ TEST_DISPLAY_CATEGORY

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_DISPLAY_CATEGORY = "TEST_DISPLAY_CATEGORY"
static

A Test display category.

◆ TEST_ENDPOINT_ID_1

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_ENDPOINT_ID_1 = "1"
static

Test string for endpointID 1.

◆ TEST_ENDPOINT_ID_2

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_ENDPOINT_ID_2 = "2"
static

Test string for endpointId 2.

◆ TEST_EVENT_CORRELATION_TOKEN

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_EVENT_CORRELATION_TOKEN = "TEST_EVENT_CORRELATION_TOKEN"
static

The test string for eventCorrelationToken sent in headers.

◆ TEST_MANUFACTURER_NAME

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_MANUFACTURER_NAME = "TEST_MANUFACTURER_NAME"
static

A Test manufacturer name.

◆ TEST_PRODUCT_ID

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_PRODUCT_ID = "TEST_PRODUCT_ID"
static

A Test product Id.

◆ TEST_PRODUCT_ID_KEY

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_PRODUCT_ID_KEY = "TEST_PRODUCT_ID_KEY"
static

A Test product Id Key.

◆ TEST_REGISTRATION_KEY

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_REGISTRATION_KEY = "TEST_REGISTRATION_KEY"
static

A Test product Id.

◆ TEST_RETRY_COUNT

constexpr int alexaClientSDK::capabilitiesDelegate::test::TEST_RETRY_COUNT = 2
static

The test retry count.

◆ TEST_SERIAL_NUMBER

const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_SERIAL_NUMBER = "TEST_SERIAL_NUMBER"
static

A Test serial number.

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