AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Functions | Variables
DiscoveryEventSenderTest.cpp File Reference
#include <memory>
#include <thread>
#include <gmock/gmock.h>
#include <AVSCommon/SDKInterfaces/MockMessageSender.h>
#include <AVSCommon/SDKInterfaces/PostConnectOperationInterface.h>
#include <AVSCommon/Utils/JSON/JSONUtils.h>
#include <CapabilitiesDelegate/DiscoveryEventSender.h>
#include "MockAuthDelegate.h"
Include dependency graph for DiscoveryEventSenderTest.cpp:

Classes

struct  alexaClientSDK::capabilitiesDelegate::test::EventData
 
class  alexaClientSDK::capabilitiesDelegate::test::MockDiscoveryStatusObserver
 
class  alexaClientSDK::capabilitiesDelegate::test::DiscoveryEventSenderTest
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::capabilitiesDelegate
 
 alexaClientSDK::capabilitiesDelegate::test
 

Functions

bool alexaClientSDK::capabilitiesDelegate::test::parseAuthToken (const std::string &payloadString, EventData *eventData)
 
bool alexaClientSDK::capabilitiesDelegate::test::parseEndpointsIds (const std::string &payloadString, EventData *eventData)
 
bool alexaClientSDK::capabilitiesDelegate::test::parseEventJson (const std::string &eventJson, EventData *eventData)
 
void alexaClientSDK::capabilitiesDelegate::test::validateDiscoveryEvent (const EventData &eventData, const std::string &eventName, const std::vector< std::string > &endpointIds=std::vector< std::string >())
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_createWithInvalidParams)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_sendsDiscoveryEvents)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_sendsDiscoveryEventsNotWaitForEventProcessed)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsFailsWithNullMessageSender)
 
static int alexaClientSDK::capabilitiesDelegate::test::getExpectedNumberOfDiscoveryEventsFromEndpointNum (int numEndpoints)
 
static int alexaClientSDK::capabilitiesDelegate::test::getExpectedNumberOfDiscoveryEventFromPayloadSize (int endpointPayloadSize)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsSplitsEventsWithMaxEndpoints)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsSplitsEventsWhenMaxPayloadSizeIsReached)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_deleteReportEventReceives4xxResponse)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsWhenAuthTokenIsEmpty)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_addOrUpdateReportReceives4xxResponse)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_retriesWhenAddOrUpdateReportReceives5xxResponse)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_addOrUpdateRetriesThenSuccessfulResponse)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_deleteReportRetriesThenSuccessfulResponse)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_retriesWhenEventProcessedDirectiveIsNotReceived)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_retriesWhenInvalidEventProcessedDirectiveIsReceived)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_stopWhenWaitingOnEventProcessedDirective)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_stopWhenAuthTokenIsRequested)
 
 alexaClientSDK::capabilitiesDelegate::test::TEST_F (DiscoveryEventSenderTest, test_sendDiscoveryEventsFailsWhenCalledTwice)
 

Variables

static const std::string alexaClientSDK::capabilitiesDelegate::test::DISCOVERY_NAMESPACE = "Alexa.Discovery"
 The Discovery event Namsepace. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::ADD_OR_UPDATE_REPORT_NAME = "AddOrUpdateReport"
 The AddOrUpdateReport Namespace. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::DELETE_REPORT_NAME = "DeleteReport"
 The DeleteReport Namespace. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::DISCOVERY_PAYLOAD_VERSION = "3"
 The payload version of the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::ENDPOINTS_KEY = "endpoints"
 The scope key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::ENDPOINTID_KEY = "endpointId"
 The scope key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::EVENT_KEY = "event"
 The event key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::HEADER_KEY = "header"
 The header key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::NAMESPACE_KEY = "namespace"
 The namespace key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::NAME_KEY = "name"
 The name key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::PAYLOAD_VERSION_KEY = "payloadVersion"
 The payload version key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::EVENT_CORRELATION_TOKEN_KEY = "eventCorrelationToken"
 The eventCorrelationToken key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::PAYLOAD_KEY = "payload"
 The payload key in the discovery event. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_AUTH_TOKEN = "TEST_AUTH_TOKEN"
 Test string for auth token. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_ENDPOINT_ID_1 = "1"
 Test string for endpointID 1. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_ENDPOINT_ID_2 = "2"
 Test string for endpointId 2. More...
 
static const std::unordered_map< std::string, std::string > alexaClientSDK::capabilitiesDelegate::test::TEST_ADD_OR_UPDATE_ENDPOINTS
 The test endpointId to endpointConfig map AddOrUpdateReport event endpoints. More...
 
static const std::unordered_map< std::string, std::string > alexaClientSDK::capabilitiesDelegate::test::TEST_DELETE_ENDPOINTS
 The test endpointId to endpointConfig map DeleteReport event endpoints. More...
 
static const std::vector< std::string > alexaClientSDK::capabilitiesDelegate::test::EXPECTED_ADD_OR_UPDATE_ENDPOINT_IDS = {TEST_ENDPOINT_ID_1}
 The expected AddOrUpdateReport endpoint Ids. More...
 
static const std::vector< std::string > alexaClientSDK::capabilitiesDelegate::test::EXPECTED_DELETE_ENDPOINT_IDS = {TEST_ENDPOINT_ID_2}
 The expected DeleteReport endpoint Ids. More...
 
static const std::string alexaClientSDK::capabilitiesDelegate::test::TEST_EVENT_CORRELATION_TOKEN = "TEST_EVENT_CORRELATION_TOKEN"
 The test string for eventCorrelationToken sent in headers. More...
 
static constexpr int alexaClientSDK::capabilitiesDelegate::test::TEST_RETRY_COUNT = 2
 The test retry count. More...
 
static constexpr int alexaClientSDK::capabilitiesDelegate::test::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 alexaClientSDK::capabilitiesDelegate::test::MAX_ENDPOINTS_SIZE_IN_PAYLOAD = 246 * 1024
 Maximum size of Discovery event (246KB) More...
 

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