AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Functions | Variables
JSONUtilTest.cpp File Reference
#include <memory>
#include <map>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <rapidjson/document.h>
#include "AVSCommon/AVS/AVSDirective.h"
#include "AVSCommon/Utils/JSON/JSONUtils.h"
Include dependency graph for JSONUtilTest.cpp:

Classes

class  alexaClientSDK::avsCommon::utils::json::test::JSONUtilTest
 Define test fixture for testing AVSMessage. More...
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::avsCommon
 
 alexaClientSDK::avsCommon::utils
 
 alexaClientSDK::avsCommon::utils::json
 
 alexaClientSDK::avsCommon::utils::json::test
 

Functions

 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_validJsonChildObjectAsString)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_validJsonScalarString)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_validJsonInteger)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveValueStringBasedInt64FromInvalidJSON)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveValueStringBasedStringFromInvalidJSON)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveValueStringBasedWithIncorrectKey)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveValueStringBasedWithNull)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveValueDocumentBasedWithInvalidValueType)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveValueDocumentBasedWithNull)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveValueDocumentBasedWithValidInt64)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_findNodeNull)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_findNodeKeyExists)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_findNodeKeyMissing)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_parseJSONNullOutputParam)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_parseJSONValidJSON)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_parseJSONInvalidJSON)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToStringValueWithString)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToStringValueWithObject)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToStringValueWithInvalidValue)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToStringValueWithNullOutputParam)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToInt64ValueWithInt64)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToInt64ValueWithDouble)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToUint64ValueWithNullOutputParam)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToUint64ValueWithUint64)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToUint64ValueWithDouble)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToInt64ValueWithNullOutputParam)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToBoolValueWithNullOutputParam)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToBoolValueWithNonBool)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToBoolValueWithBool)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringArraySucceed)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringArrayEmpty)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringArrayNonArray)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringArrayNonJson)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringArrayWithNonStringArrayFails)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToJsonStringFromEmptySet)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToJsonStringFromStringSet)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_convertToJsonFromStringVector)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveElementsWithKeySucceed)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveMixStringNonStringElementsWithKeySucceed)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveElementsWithKeyEmptyArray)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveElementsWithKeyNonArray)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveElementsWithKeyMissing)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveArrayOfElementsWithKeySucceed)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayOnlyKeyEntry)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayInvalidEntry)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringMapFromArray)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayMultiple)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayAll)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayNoneFew)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayNoneAll)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArray)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArrayInvalidEntry)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArrayInvalidKey)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArrayEmptyArray)
 
 alexaClientSDK::avsCommon::utils::json::test::TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArrayEmptyMap)
 

Variables

static const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_HEADER_STRING = "header"
 The header key in the JSON content of an AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_NAMESPACE_STRING = "namespace"
 The namespace key in the JSON content of an AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_NAME_STRING = "name"
 The name key in the JSON content of an AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_ID_STRING = "messageId"
 The messageId key in the JSON content of an AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_DIALOG_REQUEST_ID_STRING = "dialogRequestId"
 The dialogRequestId key in the JSON content of an AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_PAYLOAD_STRING = "payload"
 The payload key in the JSON content of an AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::DIRECTIVE_KEY = "directive"
 The directive key in the JSON content of an AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::NAMESPACE_TEST = "SpeechSynthesizer"
 The namespace in AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::NAME_TEST = "Speak"
 The name field in AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::MESSAGE_ID_TEST = "testMessageId"
 The messageId in AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::DIALOG_REQUEST_ID_TEST = "dialogRequestIdTest"
 The dialogRequestId in AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::PAYLOAD_TEST = R"({"url":"cid:testCID","format":"testFormat","token":"testToken"})"
 The payload in AVS message. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::OUTPUT_DEFAULT_TEXT_STRING = "defaultString"
 A random text to test the output value modification. More...
 
static const int alexaClientSDK::avsCommon::utils::json::test::OUTPUT_DEFAULT_INT_VALUE = 42
 A random integer to test the output value modification. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::EXPECTED_STRING_VALUE = "expectedValue"
 Expected string value. More...
 
static const int alexaClientSDK::avsCommon::utils::json::test::EXPECTED_INT_VALUE = 123
 Expected int value. More...
 
static const uint64_t alexaClientSDK::avsCommon::utils::json::test::EXPECTED_UNSIGNED_INT64_VALUE = UINT64_MAX
 Expected uint64_t value. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::EXPECTED_INT_VALUE_STRINGIFIED = "123"
 Expected int value converted to a string. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::EMPTY_DIRECTIVE
 An invalid AVS directive JSON.``. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::SPEAK_DIRECTIVE
 A sample AVS speak directive with all valid JSON keys. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::VALUE_KEY = "anInt64"
 The JSON key used in value reading tests. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::MISSING_KEY = "missingKey"
 A JSON key not used in value reading tests. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::INVALID_JSON = "invalidTestJSON"
 An invalid JSON string for testing. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::VALID_JSON_STRING_VALUE = R"({")" + VALUE_KEY + R"(":")" + EXPECTED_STRING_VALUE + R"("})"
 A valid JSON string with scalar string value. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::VALID_JSON_INTEGER_VALUE
 A valid JSON string with integer value. More...
 
static const double alexaClientSDK::avsCommon::utils::json::test::A_DOUBLE = 1.0
 A double. More...
 
static const bool alexaClientSDK::avsCommon::utils::json::test::A_BOOL = false
 A bool used for construction of rapidjson::Value objects. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::STRING_VALUE = "stringValue"
 A valid string JSON Value. More...
 
static const std::string alexaClientSDK::avsCommon::utils::json::test::STRING_VALUE_EMPTY_JSON_OBJECT = "{}"
 A valid empty string JSON Value. 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