AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Classes | |
class | DiscoveryUtilsTest |
Typedefs | |
using | Properties = CapabilityConfiguration::Properties |
Alias for CapabilityConfiguration::Properties. More... | |
Functions | |
AVSDiscoveryEndpointAttributes | getTestEndpointAttributes () |
AVSDiscoveryEndpointAttributes | createEndpointAttributes (const std::string &endpointId, const std::string &friendlyName, const std::string &description, const std::string &manufacturerName, const std::vector< std::string > &displayCategories) |
void | validateEndpointConfigJson (const std::string &endpointConfigJson) |
void | validateDiscoveryEvent (const std::string &eventJson, const std::string &expectedName, const std::string &expectedAuthToken, const std::vector< std::string > &expectedEndpointIds, const std::string &expectedEventCorrelationToken="") |
TEST_F (DiscoveryUtilsTest, test_validateCapabilityConfiguration) | |
TEST_F (DiscoveryUtilsTest, test_validateAVSDiscoveryEndpointAttributes) | |
TEST_F (DiscoveryUtilsTest, test_formatEndpointConfigJson) | |
TEST_F (DiscoveryUtilsTest, test_getDeleteReportEndpointConfigJson) | |
TEST_F (DiscoveryUtilsTest, test_discoveryAddOrUpdateReportEvent) | |
TEST_F (DiscoveryUtilsTest, test_deleteReportEvent) | |
TEST_F (DiscoveryUtilsTest, test_compareEndpointConfigJsons) | |
Variables | |
static const std::string | TEST_TYPE_1 = "TEST_TYPE_1" |
A Test CapabilityConfiguration type. More... | |
static const std::string | TEST_INTERFACE_NAME_1 = "TEST_INTERFACE_NAME_1" |
A Test CapabilityConfiguration interface name. More... | |
static const std::string | TEST_VERSION_1 = "TEST_VERSION_1" |
A Test CapabilityConfiguration version. More... | |
static const std::string | TEST_TYPE_2 = "TEST_TYPE_2" |
A Test CapabilityConfiguration type. More... | |
static const std::string | TEST_INTERFACE_NAME_2 = "TEST_INTERFACE_NAME_2" |
A Test CapabilityConfiguration interface name. More... | |
static const std::string | TEST_VERSION_2 = "TEST_VERSION_2" |
A Test CapabilityConfiguration version. More... | |
static const Optional< std::string > | TEST_INSTANCE_NAME ("TEST_INSTANCE_NAME") |
A Test CapabilityConfiguration instance name. More... | |
static const std::vector< std::string > | TEST_SUPPORTED_LIST {"TEST_PROPERTY_1", "TEST_PROPERTY_2"} |
A Test CapabilityConfiguration properties supportedList. More... | |
static const Optional< Properties > | TEST_PROPERTIES = Properties(false, false, TEST_SUPPORTED_LIST) |
A Test CapabilityConfiguration Optional properties. More... | |
static const std::string | EXPECTED_TEST_PROPERTIES_STRING |
A Test CapabilityConfiguration supported properties string. More... | |
static const std::string | TEST_VALID_CONFIG_JSON = R"({"key":{"key1":"value1"}})" |
A Test valid JSON value. More... | |
static const CapabilityConfiguration::AdditionalConfigurations | TEST_ADDITIONAL_CONFIGURATIONS |
A Test CapabilityConfiguration type. More... | |
static const std::string | TEST_ENDPOINT_ID = "TEST_ENDPOINT_ID" |
A Test Endpoint Id. More... | |
static const std::string | TEST_FRIENDLY_NAME = "TEST_FRIENDLY_NAME" |
A Test Friendly name. More... | |
static const std::string | TEST_DESCRIPTION = "TEST_DESCRIPTION" |
A Test description. More... | |
static const std::string | TEST_MANUFACTURER_NAME = "TEST_MANUFACTURER_NAME" |
A Test manufacturer name. More... | |
static const std::vector< std::string > | TEST_DISPLAY_CATEGORIES = {"TEST_DISPLAY_CATEGORY_1", "TEST_DISPLAY_CATEGORY_2"} |
A Test display category list. More... | |
static const std::string | TEST_CUSTOMER_IDENTIFIER = "TEST_CUSTOMER_IDENTIFIER" |
A Test customer identifier. More... | |
static const std::string | TEST_SOFTWARE_VERSION = "TEST_SOFTWARE_VERSION" |
A Test software version. More... | |
static const std::string | TEST_FIRMWARE_VERSION = "TEST_FIRMWARE_VERSION" |
A Test firmware version. More... | |
static const std::string | TEST_SERIAL_NUMBER = "TEST_SERIAL_NUMBER" |
A Test serial number. More... | |
static const std::string | TEST_MODEL = "TEST_MODEL" |
A Test model. More... | |
static const std::string | TEST_MANUFACTURER = "TEST_MANUFACTURER" |
A Test manufacturer. More... | |
static const std::string | TEST_PRODUCT_ID = "TEST_PRODUCT_ID" |
A Test product ID. More... | |
static const std::string | TEST_REGISTRATION_KEY = "TEST_REGISTRATION_KEY" |
A Test registration key. More... | |
static const std::string | TEST_PRODUCT_ID_KEY = "TEST_PRODUCT_ID_KEY" |
A Test product ID key. More... | |
static const std::string | TEST_ENDPOINT_CONFIG = R"({"endpointId":")" + TEST_ENDPOINT_ID + R"("})" |
A Test Endpoint configuration JSON. More... | |
static const std::string | TEST_AUTH_TOKEN = "TEST_AUTH_TOKEN" |
A Test auth token. More... | |
static const std::vector< std::map< std::string, std::string > > | TEST_CONNECTIONS_DATA |
A test connections data. More... | |
static const std::map< std::string, std::string > | TEST_COOKIE_DATA = {{"KEY1", "VALUE1"}, {"KEY2", "VALUE2"}} |
A test cookie data. More... | |
static const std::string | ADD_OR_UPDATE_REPORT_EVENT_NAME = "AddOrUpdateReport" |
The expected name that appears in the header of the Discovery.AddOrUpdateReport event. More... | |
static const std::string | DELETE_REPORT_EVENT_NAME = "DeleteReport" |
The expected name that appears in the header of the Discovery.DeleteReport event. More... | |
using alexaClientSDK::capabilitiesDelegate::utils::test::Properties = typedef CapabilityConfiguration::Properties |
Alias for CapabilityConfiguration::Properties.
AVSDiscoveryEndpointAttributes alexaClientSDK::capabilitiesDelegate::utils::test::createEndpointAttributes | ( | const std::string & | endpointId, |
const std::string & | friendlyName, | ||
const std::string & | description, | ||
const std::string & | manufacturerName, | ||
const std::vector< std::string > & | displayCategories | ||
) |
Creates an AVSDiscoveryEndpointAttributes
structure using the parameters passed in.
endpointId | The endpoint ID string. |
friendlyName | The friendly name string. |
description | The description string. |
manufacturerName | The manufacturer name string. |
displayCategories | The display categories list. |
AVSDiscoveryEndpointAttributes
structure containing the params passed in. AVSDiscoveryEndpointAttributes alexaClientSDK::capabilitiesDelegate::utils::test::getTestEndpointAttributes | ( | ) |
This method returns a test AVSDiscoveryEndpointAttributes
structure.
AVSDiscoveryEndpointAttributes
structure containing test fields. alexaClientSDK::capabilitiesDelegate::utils::test::TEST_F | ( | DiscoveryUtilsTest | , |
test_validateCapabilityConfiguration | |||
) |
Test if the validateCapabilityConfiguration method works as expected.
Invalid Type
Invalid Interface Name
Invalid Version
Invalid instance name
Invalid supported list
Invalid custom configuration
Valid case with fully loaded CapabilityConfiguration
.
alexaClientSDK::capabilitiesDelegate::utils::test::TEST_F | ( | DiscoveryUtilsTest | , |
test_validateAVSDiscoveryEndpointAttributes | |||
) |
Test if the validateAVSDiscoveryEndpointAttributes method works as expected.
Invalid EndpointID.
Invalid Description
Invalid Manufacturer Name
Invalid Display Categories
Valid Endpoint Attributes
alexaClientSDK::capabilitiesDelegate::utils::test::TEST_F | ( | DiscoveryUtilsTest | , |
test_formatEndpointConfigJson | |||
) |
Test if the getEndpointConfigJson method works as expected.
Check if endpoint configuration is valid even after flipping the contents of the capabilities array.
alexaClientSDK::capabilitiesDelegate::utils::test::TEST_F | ( | DiscoveryUtilsTest | , |
test_getDeleteReportEndpointConfigJson | |||
) |
Test Endpoint configuration json for DeleteReport events.
alexaClientSDK::capabilitiesDelegate::utils::test::TEST_F | ( | DiscoveryUtilsTest | , |
test_discoveryAddOrUpdateReportEvent | |||
) |
Test event format for Discovery.AddOrUpdateReport
event.
alexaClientSDK::capabilitiesDelegate::utils::test::TEST_F | ( | DiscoveryUtilsTest | , |
test_deleteReportEvent | |||
) |
Test event format for Discovery.DeleteReport
event.
alexaClientSDK::capabilitiesDelegate::utils::test::TEST_F | ( | DiscoveryUtilsTest | , |
test_compareEndpointConfigJsons | |||
) |
Contents of the JSON are same.
Elements out of order
Order of arrays doesn't match
void alexaClientSDK::capabilitiesDelegate::utils::test::validateDiscoveryEvent | ( | const std::string & | eventJson, |
const std::string & | expectedName, | ||
const std::string & | expectedAuthToken, | ||
const std::vector< std::string > & | expectedEndpointIds, | ||
const std::string & | expectedEventCorrelationToken = "" |
||
) |
Parses the JSON and validates if the expected fields for Discovery
events are present.
eventJson | The JSON string representation of the event which will be validated. |
expectedName | The expected name of the event. |
expectedAuthToken | The expected authorization token of the event. |
expectedEndpointIds | The expected endpointIds to be sent in the event. |
expectedEventCorrelationToken | The expected eventCorrelationToken that needs to be sent. |
header
Payload
Scope
Endpoints
void alexaClientSDK::capabilitiesDelegate::utils::test::validateEndpointConfigJson | ( | const std::string & | endpointConfigJson | ) |
Parses the JSON and validates if the expected fields for AVSDiscoveryEndpointAttributes
are present.
endpointConfigJson | The JSON string representation of the endpoint attributes which will be validated. |
Additional Attributes
Registration
Connections
iterate through connections
Cookie
Capabilities
iterate through capabilities array.
|
static |
The expected name that appears in the header of the Discovery.AddOrUpdateReport
event.
|
static |
The expected name that appears in the header of the Discovery.DeleteReport
event.
|
static |
A Test CapabilityConfiguration supported properties string.
|
static |
A Test CapabilityConfiguration type.
|
static |
A Test auth token.
|
static |
A test connections data.
|
static |
A test cookie data.
|
static |
A Test customer identifier.
|
static |
A Test description.
|
static |
A Test display category list.
|
static |
A Test Endpoint configuration JSON.
|
static |
A Test Endpoint Id.
|
static |
A Test firmware version.
|
static |
A Test Friendly name.
|
static |
A Test CapabilityConfiguration instance name.
|
static |
A Test CapabilityConfiguration interface name.
|
static |
A Test CapabilityConfiguration interface name.
|
static |
A Test manufacturer.
|
static |
A Test manufacturer name.
|
static |
A Test model.
|
static |
A Test product ID.
|
static |
A Test product ID key.
|
static |
A Test CapabilityConfiguration Optional properties.
|
static |
A Test registration key.
|
static |
A Test serial number.
|
static |
A Test software version.
|
static |
A Test CapabilityConfiguration properties supportedList.
|
static |
A Test CapabilityConfiguration type.
|
static |
A Test CapabilityConfiguration type.
|
static |
A Test valid JSON value.
|
static |
A Test CapabilityConfiguration version.
|
static |
A Test CapabilityConfiguration version.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0