diff --git a/docs/dataservice-cache-example.md b/docs/dataservice-cache-example.md index 8e2ac3420..b355c14f5 100644 --- a/docs/dataservice-cache-example.md +++ b/docs/dataservice-cache-example.md @@ -89,7 +89,7 @@ You can get data from a [versioned layer](https://www.here.com/docs/bundle/data- olp::dataservice::read::VersionedLayerClient layer_client ( client::HRN catalog, std::string layer_id, - boost::optional catalog_version, + porting::optional catalog_version, client::OlpClientSettings settings); ``` @@ -102,7 +102,7 @@ You can get data from a [versioned layer](https://www.here.com/docs/bundle/data- ```cpp auto request = olp::dataservice::read::DataRequest() .WithPartitionId(first_partition_id) - .WithBillingTag(boost::none) + .WithBillingTag(olp::porting::none) .WithFetchOption(olp::dataservice::read::FetchOptions::OnlineIfNotFound); ``` diff --git a/docs/dataservice-read-catalog-example.md b/docs/dataservice-read-catalog-example.md index b52a36407..127bece5a 100644 --- a/docs/dataservice-read-catalog-example.md +++ b/docs/dataservice-read-catalog-example.md @@ -359,7 +359,7 @@ You can request any data version from a [versioned layer](https://www.here.com/d olp::dataservice::read::VersionedLayerClient layer_client ( client::HRN catalog, std::string layer_id, - boost::optional catalog_version, + porting::optional catalog_version, client::OlpClientSettings settings); ``` diff --git a/examples/ProtectedCacheExample.cpp b/examples/ProtectedCacheExample.cpp index 4f1875db8..973735e7c 100644 --- a/examples/ProtectedCacheExample.cpp +++ b/examples/ProtectedCacheExample.cpp @@ -62,13 +62,15 @@ bool HandleDataResponse( } // namespace int RunExampleReadWithCache(const AccessKey& access_key, - const olp::cache::CacheSettings& cache_settings, const std::string& catalog) { + const olp::cache::CacheSettings& cache_settings, + const std::string& catalog) { OLP_SDK_LOG_INFO_F( kLogTag, "Mutable cache path is \"%s\"", - cache_settings.disk_path_mutable.get_value_or("none").c_str()); + olp::porting::value_or(cache_settings.disk_path_mutable, "none").c_str()); OLP_SDK_LOG_INFO_F( kLogTag, "Protected cache path is \"%s\"", - cache_settings.disk_path_protected.get_value_or("none").c_str()); + olp::porting::value_or(cache_settings.disk_path_protected, "none") + .c_str()); // Create a task scheduler instance std::shared_ptr task_scheduler = olp::client::OlpClientSettingsFactory::CreateDefaultTaskScheduler(1u); @@ -84,8 +86,8 @@ int RunExampleReadWithCache(const AccessKey& access_key, olp::authentication::AuthenticationCredentials::ReadFromFile(); // Initialize authentication settings. - olp::authentication::Settings settings{ - read_credentials_result.get_value_or({access_key.id, access_key.secret})}; + olp::authentication::Settings settings{olp::porting::value_or( + read_credentials_result, {access_key.id, access_key.secret})}; settings.task_scheduler = task_scheduler; settings.network_request_handler = http_client; @@ -108,14 +110,14 @@ int RunExampleReadWithCache(const AccessKey& access_key, // Create appropriate layer client with HRN, layer name and settings. olp::dataservice::read::VersionedLayerClient layer_client( - olp::client::HRN(catalog), first_layer_id, boost::none, client_settings); + olp::client::HRN(catalog), first_layer_id, olp::porting::none, + client_settings); // Retrieve the partition data // Create a DataRequest with appropriate LayerId and PartitionId - auto request = olp::dataservice::read::DataRequest() - .WithPartitionId(first_partition_id) - .WithBillingTag(boost::none); - if (cache_settings.disk_path_protected.is_initialized()) { + auto request = + olp::dataservice::read::DataRequest().WithPartitionId(first_partition_id); + if (cache_settings.disk_path_protected.has_value()) { request.WithFetchOption(olp::dataservice::read::FetchOptions::CacheOnly); } @@ -123,8 +125,7 @@ int RunExampleReadWithCache(const AccessKey& access_key, auto future = layer_client.GetData(request); // Wait for DataResponse - olp::dataservice::read::DataResponse data_response = - future.GetFuture().get(); + olp::dataservice::read::DataResponse data_response = future.GetFuture().get(); // Compact mutable cache, so it can be used as protected cache cache->Compact(); @@ -133,8 +134,8 @@ int RunExampleReadWithCache(const AccessKey& access_key, return (HandleDataResponse(data_response) ? 0 : -1); } -int RunExampleProtectedCache(const AccessKey& access_key, const std::string& catalog) -{ +int RunExampleProtectedCache(const AccessKey& access_key, + const std::string& catalog) { // Read data with mutable cache. olp::cache::CacheSettings cache_settings; cache_settings.disk_path_mutable = @@ -145,6 +146,6 @@ int RunExampleProtectedCache(const AccessKey& access_key, const std::string& cat } // Read data with protected cache. Set mutable cache to none. cache_settings.disk_path_protected = cache_settings.disk_path_mutable; - cache_settings.disk_path_mutable = boost::none; + cache_settings.disk_path_mutable = olp::porting::none; return RunExampleReadWithCache(access_key, cache_settings, catalog); } diff --git a/examples/ReadExample.cpp b/examples/ReadExample.cpp index 99e36de39..855549ffe 100644 --- a/examples/ReadExample.cpp +++ b/examples/ReadExample.cpp @@ -119,7 +119,7 @@ bool HandleDataResponse( } // namespace int RunExampleRead(const AccessKey& access_key, const std::string& catalog, - const boost::optional& catalog_version) { + const olp::porting::optional& catalog_version) { // Create a task scheduler instance std::shared_ptr task_scheduler = olp::client::OlpClientSettingsFactory::CreateDefaultTaskScheduler(1u); @@ -135,8 +135,8 @@ int RunExampleRead(const AccessKey& access_key, const std::string& catalog, olp::authentication::AuthenticationCredentials::ReadFromFile(); // Initialize authentication settings. - olp::authentication::Settings settings{ - read_credentials_result.get_value_or({access_key.id, access_key.secret})}; + olp::authentication::Settings settings{olp::porting::value_or( + read_credentials_result, {access_key.id, access_key.secret})}; settings.task_scheduler = task_scheduler; settings.network_request_handler = http_client; @@ -161,8 +161,8 @@ int RunExampleRead(const AccessKey& access_key, const std::string& catalog, olp::client::HRN(catalog), client_settings); // Create CatalogRequest - auto request = - olp::dataservice::read::CatalogRequest().WithBillingTag(boost::none); + auto request = olp::dataservice::read::CatalogRequest().WithBillingTag( + olp::porting::none); // Run the CatalogRequest auto future = catalog_client.GetCatalog(request); @@ -184,8 +184,8 @@ int RunExampleRead(const AccessKey& access_key, const std::string& catalog, if (!first_layer_id.empty()) { // Retrieve the partitions metadata // Create a PartitionsRequest with appropriate LayerId - auto request = - olp::dataservice::read::PartitionsRequest().WithBillingTag(boost::none); + auto request = olp::dataservice::read::PartitionsRequest().WithBillingTag( + olp::porting::none); // Run the PartitionsRequest auto future = layer_client.GetPartitions(request); @@ -204,9 +204,8 @@ int RunExampleRead(const AccessKey& access_key, const std::string& catalog, if (!first_partition_id.empty()) { // Retrieve the partition data // Create a DataRequest with appropriate LayerId and PartitionId - auto request = olp::dataservice::read::DataRequest() - .WithPartitionId(first_partition_id) - .WithBillingTag(boost::none); + auto request = olp::dataservice::read::DataRequest().WithPartitionId( + first_partition_id); // Run the DataRequest auto future = layer_client.GetData(request); diff --git a/examples/ReadExample.h b/examples/ReadExample.h index 84bcef1cc..c4eb8c565 100644 --- a/examples/ReadExample.h +++ b/examples/ReadExample.h @@ -21,7 +21,7 @@ #include "Examples.h" -#include +#include /** * @brief Dataservice read example. Authenticate client using access key id and @@ -33,6 +33,6 @@ * @param catalog_version The desired version of the catalog. * @return result of publish data(0 - if succeed) */ -int RunExampleRead( - const AccessKey& access_key, const std::string& catalog, - const boost::optional& catalog_version = boost::none); +int RunExampleRead(const AccessKey& access_key, const std::string& catalog, + const olp::porting::optional& catalog_version = + olp::porting::none); diff --git a/examples/StreamLayerReadExample.cpp b/examples/StreamLayerReadExample.cpp index 17dc3fc9d..411086010 100644 --- a/examples/StreamLayerReadExample.cpp +++ b/examples/StreamLayerReadExample.cpp @@ -63,8 +63,7 @@ int GetDataFromMessages(dataread::StreamLayerClient& client, auto handle = message.GetMetaData().GetDataHandle(); if (handle) { OLP_SDK_LOG_INFO_F(kLogTag, "Message data: handle - %s, size - %lu", - handle.get().c_str(), - message.GetMetaData().GetDataSize().get()); + handle->c_str(), *message.GetMetaData().GetDataSize()); // use GetData(const model::Message& message) with message instance to // request actual data with data handle. auto message_future = client.GetData(message); @@ -73,14 +72,14 @@ int GetDataFromMessages(dataread::StreamLayerClient& client, OLP_SDK_LOG_WARNING_F(kLogTag, "Failed to get data for data handle %s - HTTP " "Status: %d Message: %s", - handle.get().c_str(), + handle->c_str(), message_result.GetError().GetHttpStatusCode(), message_result.GetError().GetMessage().c_str()); continue; } auto message_data = message_result.MoveResult(); OLP_SDK_LOG_INFO_F(kLogTag, "GetData for %s successful: size - %lu", - handle.get().c_str(), message_data->size()); + handle->c_str(), message_data->size()); } else { // If data is less than 1 MB, the data content published directly in the // metadata and encoded in Base64. diff --git a/examples/main.cpp b/examples/main.cpp index ab2506b3d..93b3cadd5 100644 --- a/examples/main.cpp +++ b/examples/main.cpp @@ -20,8 +20,8 @@ #include "Options.h" #include "ProtectedCacheExample.h" #include "ReadExample.h" -#include "WriteExample.h" #include "StreamLayerReadExample.h" +#include "WriteExample.h" #include #include @@ -68,7 +68,7 @@ int RequiredArgumentError(const tools::Option& arg) { } int ParseArguments(const int argc, char** argv, AccessKey& access_key, std::string& catalog, - boost::optional& catalog_version, + olp::porting::optional& catalog_version, std::string& layer_id, olp::dataservice::read::SubscribeRequest::SubscriptionMode& subscription_mode) { @@ -128,7 +128,7 @@ int ParseArguments(const int argc, char** argv, AccessKey& access_key, if (ss.fail() || !ss.eof()) { std::cout << "invalid catalog version value -- '" << *it << "', but int64 is expected." << std::endl; - catalog_version = boost::none; + catalog_version = olp::porting::none; } } else if (IsMatch(*it, tools::kLayerIdOption)) { if (++it == arguments.end()) { @@ -168,7 +168,7 @@ int ParseArguments(const int argc, char** argv, AccessKey& access_key, int RunExamples(const AccessKey& access_key, int examples_to_run, const std::string& catalog, - const boost::optional& catalog_version, + const olp::porting::optional& catalog_version, const std::string& layer_id, olp::dataservice::read::SubscribeRequest::SubscriptionMode subscription_mode) { @@ -210,10 +210,10 @@ int RunExamples(const AccessKey& access_key, int examples_to_run, int main(int argc, char** argv) { AccessKey access_key{}; // You can specify your here.access.key.id // and here.access.key.secret - std::string catalog; // the HRN of the catalog to which you to publish data - std::string layer_id; // the of the layer inside the catalog to which you - // want to publish data - boost::optional catalog_version; // version of the catalog. + std::string catalog; // the HRN of the catalog to which you to publish data + std::string layer_id; // the of the layer inside the catalog to which you + // want to publish data + olp::porting::optional catalog_version; // version of the catalog. auto subscription_mode = olp::dataservice::read::SubscribeRequest::SubscriptionMode:: kSerial; // subscription mode for read stream layer example diff --git a/tests/common/PlatformUrlsGenerator.cpp b/tests/common/PlatformUrlsGenerator.cpp index fc547c269..6ecaf965d 100644 --- a/tests/common/PlatformUrlsGenerator.cpp +++ b/tests/common/PlatformUrlsGenerator.cpp @@ -20,11 +20,10 @@ #include "PlatformUrlsGenerator.h" #include +#include #include #include -#include -#include #include "ApiDefaultResponses.h" namespace { diff --git a/tests/common/ReadDefaultResponses.cpp b/tests/common/ReadDefaultResponses.cpp index 835206f19..39b664a09 100644 --- a/tests/common/ReadDefaultResponses.cpp +++ b/tests/common/ReadDefaultResponses.cpp @@ -112,8 +112,8 @@ void FillSubQuads(std::int32_t depth, std::vector& sub_quads_) { sub_quads_.insert(sub_quads_.end(), layer_ids.begin(), layer_ids.end()); } -mockserver::TileMetadata MakePartition(std::string data_handle, - boost::optional version) { +mockserver::TileMetadata MakePartition( + std::string data_handle, olp::porting::optional version) { mockserver::TileMetadata partition; partition.data_handle = std::move(data_handle); partition.version = version; @@ -173,17 +173,17 @@ std::string ReadDefaultResponses::GenerateQuadTreeResponse( } QuadTreeBuilder::QuadTreeBuilder(olp::geo::TileKey root_tile, - boost::optional version) + olp::porting::optional version) : root_tile_(root_tile), base_version_(version) {} -QuadTreeBuilder& QuadTreeBuilder::WithParent(olp::geo::TileKey parent, - std::string data_handle, - boost::optional version) { +QuadTreeBuilder& QuadTreeBuilder::WithParent( + olp::geo::TileKey parent, std::string data_handle, + olp::porting::optional version) { assert(root_tile_.IsChildOf(parent)); // Make sure to set version when the base_version is set - if (version != boost::none) { - assert(base_version_ != boost::none); + if (version != olp::porting::none) { + assert(base_version_ != olp::porting::none); } else if (base_version_) { version = base_version_; } @@ -208,11 +208,11 @@ QuadTreeBuilder& QuadTreeBuilder::FillParents() { QuadTreeBuilder& QuadTreeBuilder::WithSubQuad( olp::geo::TileKey tile, std::string datahandle, - boost::optional version) { + olp::porting::optional version) { assert(tile.IsChildOf(root_tile_) || tile == root_tile_); assert((tile.Level() - root_tile_.Level()) <= 4); - if (version != boost::none) { - assert(base_version_ != boost::none); + if (version != olp::porting::none) { + assert(base_version_ != olp::porting::none); } auto origin = root_tile_.ChangedLevelTo(tile.Level()); diff --git a/tests/common/ReadDefaultResponses.h b/tests/common/ReadDefaultResponses.h index 6dcbe984d..53fb511f5 100644 --- a/tests/common/ReadDefaultResponses.h +++ b/tests/common/ReadDefaultResponses.h @@ -34,7 +34,7 @@ namespace mockserver { struct TileMetadata { std::string data_handle; - boost::optional version; + olp::porting::optional version; std::string crc; std::string checksum; int32_t data_size{0}; @@ -87,15 +87,17 @@ class QuadTreeBuilder { public: // if version is set, the quad tree is considered to be a versioned type. explicit QuadTreeBuilder(olp::geo::TileKey root_tile, - boost::optional base_version); + olp::porting::optional base_version); - QuadTreeBuilder& WithParent(olp::geo::TileKey parent, std::string data_handle, - boost::optional version = boost::none); + QuadTreeBuilder& WithParent( + olp::geo::TileKey parent, std::string data_handle, + olp::porting::optional version = olp::porting::none); QuadTreeBuilder& FillParents(); // tile is represented as a normal tilekey - QuadTreeBuilder& WithSubQuad(olp::geo::TileKey tile, std::string datahandle, - boost::optional version = boost::none); + QuadTreeBuilder& WithSubQuad( + olp::geo::TileKey tile, std::string datahandle, + olp::porting::optional version = olp::porting::none); std::string BuildJson() const; @@ -103,7 +105,7 @@ class QuadTreeBuilder { protected: olp::geo::TileKey root_tile_; - boost::optional base_version_; + olp::porting::optional base_version_; std::map sub_quads_; std::map parent_quads_; diff --git a/tests/functional/network/ConcurrencyTest.cpp b/tests/functional/network/ConcurrencyTest.cpp index a21ac86f1..ea2f73dce 100644 --- a/tests/functional/network/ConcurrencyTest.cpp +++ b/tests/functional/network/ConcurrencyTest.cpp @@ -38,7 +38,8 @@ constexpr auto kTimeout = std::chrono::seconds(3); class ConcurrencyTest : public NetworkTestBase { public: - void AddExpectation(int i, boost::optional delay_ms = boost::none) { + void AddExpectation( + int i, olp::porting::optional delay_ms = olp::porting::none) { const auto url = kApiBase + std::to_string(i); mock_server_client_->MockResponse( "GET", url, mockserver::ReadDefaultResponses::GenerateData(), 200, true, diff --git a/tests/functional/olp-cpp-sdk-dataservice-read/ApiTest.cpp b/tests/functional/olp-cpp-sdk-dataservice-read/ApiTest.cpp index d1b569457..1f525fb21 100644 --- a/tests/functional/olp-cpp-sdk-dataservice-read/ApiTest.cpp +++ b/tests/functional/olp-cpp-sdk-dataservice-read/ApiTest.cpp @@ -101,7 +101,7 @@ TEST_F(ApiTest, GetCatalog) { auto start_time = std::chrono::high_resolution_clock::now(); auto catalog_response = olp::dataservice::read::ConfigApi::GetCatalog( - config_client, GetTestCatalog(), boost::none, + config_client, GetTestCatalog(), olp::porting::none, olp::client::CancellationContext{}); auto end = std::chrono::high_resolution_clock::now(); @@ -126,7 +126,8 @@ TEST_F(ApiTest, GetPartitions) { auto start_time = std::chrono::high_resolution_clock::now(); auto partitions_response = olp::dataservice::read::MetadataApi::GetPartitions( - metadata_client, "testlayer", 1, {}, boost::none, boost::none, context); + metadata_client, "testlayer", 1, {}, olp::porting::none, + olp::porting::none, context); auto end = std::chrono::high_resolution_clock::now(); @@ -155,7 +156,7 @@ TEST_F(ApiTest, GetPartitionById) { std::vector partitions = {"269", "270"}; auto partitions_response = olp::dataservice::read::QueryApi::GetPartitionsbyId( - query_client, "testlayer", partitions, 1, {}, boost::none, + query_client, "testlayer", partitions, 1, {}, olp::porting::none, olp::client::CancellationContext{}); auto end = std::chrono::high_resolution_clock::now(); @@ -181,7 +182,7 @@ TEST_F(ApiTest, GetPartitionById) { auto partitions_response = olp::dataservice::read::QueryApi::GetPartitionsbyId( query_client, "testlayer", partitions, 1, additional_fields, - boost::none, olp::client::CancellationContext{}); + olp::porting::none, olp::client::CancellationContext{}); auto end = std::chrono::high_resolution_clock::now(); std::chrono::duration time = end - start_time; @@ -218,7 +219,7 @@ TEST_F(ApiTest, GetCatalogVersion) { auto start_time = std::chrono::high_resolution_clock::now(); auto version_response = olp::dataservice::read::MetadataApi::GetLatestCatalogVersion( - metadata_client, -1, boost::none, context); + metadata_client, -1, olp::porting::none, context); auto end = std::chrono::high_resolution_clock::now(); std::chrono::duration time = end - start_time; @@ -243,7 +244,7 @@ TEST_F(ApiTest, GetLayerVersions) { auto start_time = std::chrono::high_resolution_clock::now(); auto layer_versions_response = olp::dataservice::read::MetadataApi::GetLayerVersions( - metadata_client, 1, boost::none, context); + metadata_client, 1, olp::porting::none, context); auto end = std::chrono::high_resolution_clock::now(); std::chrono::duration time = end - start_time; @@ -272,7 +273,8 @@ TEST_F(ApiTest, GetBlob) { auto start_time = std::chrono::high_resolution_clock::now(); auto data_response = olp::dataservice::read::BlobApi::GetBlob( - blob_client, "testlayer", partition, boost::none, boost::none, context); + blob_client, "testlayer", partition, olp::porting::none, + olp::porting::none, context); auto end = std::chrono::high_resolution_clock::now(); std::chrono::duration time = end - start_time; @@ -298,7 +300,7 @@ TEST_F(ApiTest, DISABLED_GetVolatileBlob) { auto start_time = std::chrono::high_resolution_clock::now(); auto data_response = olp::dataservice::read::VolatileBlobApi::GetVolatileBlob( volatile_blob_client, "testlayer", "d5d73b64-7365-41c3-8faf-aa6ad5bab135", - boost::none, {}); + olp::porting::none, {}); auto end = std::chrono::high_resolution_clock::now(); std::chrono::duration time = end - start_time; @@ -329,7 +331,7 @@ TEST_F(ApiTest, QuadTreeIndex) { auto start_time = std::chrono::high_resolution_clock::now(); auto index_response = olp::dataservice::read::QueryApi::QuadTreeIndex( - query_client, layer_id, quad_key, version, depth, {}, boost::none, + query_client, layer_id, quad_key, version, depth, {}, olp::porting::none, olp::client::CancellationContext{}); auto end = std::chrono::high_resolution_clock::now(); diff --git a/tests/functional/olp-cpp-sdk-dataservice-read/DataserviceReadVersionedLayerClientTest.cpp b/tests/functional/olp-cpp-sdk-dataservice-read/DataserviceReadVersionedLayerClientTest.cpp index d5a41e96e..ebc735c34 100644 --- a/tests/functional/olp-cpp-sdk-dataservice-read/DataserviceReadVersionedLayerClientTest.cpp +++ b/tests/functional/olp-cpp-sdk-dataservice-read/DataserviceReadVersionedLayerClientTest.cpp @@ -99,7 +99,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchWideRange) { "dataservice_read_test_versioned_prefetch_tile"); auto client = std::make_unique( - catalog, kLayerId, boost::none, *settings_); + catalog, kLayerId, olp::porting::none, *settings_); { SCOPED_TRACE("Prefetch tiles online and store them in memory cache"); @@ -160,7 +160,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchWrongLevels) { "dataservice_read_test_versioned_prefetch_tile"); auto client = std::make_unique( - catalog, kLayerId, boost::none, *settings_); + catalog, kLayerId, olp::porting::none, *settings_); { SCOPED_TRACE("Prefetch tiles online and store them in memory cache"); @@ -281,7 +281,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchWithCancellableFuture) { "dataservice_read_test_versioned_prefetch_tile"); auto client = std::make_unique( - catalog, kLayerId, boost::none, *settings_); + catalog, kLayerId, olp::porting::none, *settings_); std::vector tile_keys = { olp::geo::TileKey::FromHereTile(kTileId)}; @@ -313,7 +313,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsWithInvalidHrn) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, *settings_); + hrn, "testlayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::PartitionsRequest(); auto partitions_response = @@ -332,7 +332,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitions) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, *settings_); + hrn, "testlayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::PartitionsRequest(); auto partitions_response = @@ -350,7 +350,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsForInvalidLayer) { auto catalog_client = std::make_unique( - hrn, "invalidLayer", boost::none, *settings_); + hrn, "invalidLayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::PartitionsRequest(); auto partitions_response = @@ -369,7 +369,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataWithInvalidHrn) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, *settings_); + hrn, "testlayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::DataRequest(); request.WithDataHandle("d5d73b64-7365-41c3-8faf-aa6ad5bab135"); @@ -388,7 +388,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataHandleWithInvalidLayer) { auto catalog_client = std::make_unique( - hrn, "invalidLayer", boost::none, *settings_); + hrn, "invalidLayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::DataRequest(); request.WithDataHandle("invalidDataHandle"); @@ -407,7 +407,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataWithPartitionId) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, *settings_); + hrn, "testlayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::DataRequest(); request.WithPartitionId("269"); @@ -511,7 +511,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, *settings_); + hrn, "testlayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::DataRequest(); request.WithPartitionId("noPartition"); @@ -530,7 +530,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataWithEmptyField) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, *settings_); + hrn, "testlayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::DataRequest(); request.WithPartitionId("1"); @@ -549,7 +549,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataCompressed) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, *settings_); + hrn, "testlayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::DataRequest(); request.WithPartitionId("here_van_wc2018_pool"); @@ -564,7 +564,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataCompressed) { catalog_client = std::make_unique( - hrn, "testlayer_gzip", boost::none, *settings_); + hrn, "testlayer_gzip", olp::porting::none, *settings_); auto request_compressed = olp::dataservice::read::DataRequest(); request_compressed.WithPartitionId("here_van_wc2018_pool"); auto data_response_compressed = @@ -590,7 +590,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetTile) { "dataservice_read_test_versioned_prefetch_tile"); auto client = std::make_unique( - catalog, kLayerId, boost::none, *settings_); + catalog, kLayerId, olp::porting::none, *settings_); auto request = olp::dataservice::read::TileRequest().WithTileKey( olp::geo::TileKey::FromHereTile(kTileId)); @@ -614,7 +614,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetTileWithInvalidLayerId) { "dataservice_read_test_versioned_prefetch_tile"); auto client = std::make_unique( - catalog, "invalidLayer", boost::none, *settings_); + catalog, "invalidLayer", olp::porting::none, *settings_); auto request = olp::dataservice::read::TileRequest().WithTileKey( olp::geo::TileKey::FromHereTile(kTileId)); @@ -637,7 +637,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetTileEmptyField) { "dataservice_read_test_versioned_prefetch_layer"); auto client = std::make_unique( - catalog, kLayerId, boost::none, *settings_); + catalog, kLayerId, olp::porting::none, *settings_); auto request = olp::dataservice::read::TileRequest().WithTileKey( olp::geo::TileKey::FromHereTile("")); diff --git a/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientGetDataTest.cpp b/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientGetDataTest.cpp index a3cbc1ffa..5acff1f98 100644 --- a/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientGetDataTest.cpp +++ b/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientGetDataTest.cpp @@ -54,7 +54,7 @@ TEST_F(VersionedLayerClientGetDataTest, GetDataFromPartitionSync) { } auto catalog_client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); auto future = catalog_client.GetData(read::DataRequest().WithPartitionId(partition)); @@ -86,7 +86,7 @@ TEST_F(VersionedLayerClientGetDataTest, GetDataFromPartitionAsync) { } auto catalog_client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); std::promise promise; std::future future = promise.get_future(); @@ -107,7 +107,7 @@ TEST_F(VersionedLayerClientGetDataTest, GetDataFromPartitionAsync) { TEST_F(VersionedLayerClientGetDataTest, GetDataWithHandle) { olp::client::HRN hrn(kTestHrn); - const auto data_handle = + auto data_handle = mockserver::ReadDefaultResponses::GenerateDataHandle("test"); const auto data = mockserver::ReadDefaultResponses::GenerateData(); @@ -118,10 +118,10 @@ TEST_F(VersionedLayerClientGetDataTest, GetDataWithHandle) { mock_server_client_->MockGetResponse(kLayer, data_handle, data); auto client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); auto request = read::DataRequest(); - request.WithDataHandle(data_handle); + request.WithDataHandle(std::move(data_handle)); auto future = client.GetData(request); auto data_response = future.GetFuture().get(); @@ -148,7 +148,7 @@ TEST_F(VersionedLayerClientGetDataTest, GetDataWithInvalidLayerId) { url_generator_.PartitionsQuery()); auto client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); auto request = read::DataRequest(); request.WithPartitionId("269"); @@ -220,7 +220,8 @@ TEST_F(VersionedLayerClientGetDataTest, mock_server_client_->MockGetResponse(kLayer, data_handle, tile_data); } - read::VersionedLayerClient client(kHrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient client(kHrn, kLayer, olp::porting::none, + *settings_); std::promise promise; std::future future = promise.get_future(); @@ -252,7 +253,8 @@ TEST_F(VersionedLayerClientGetDataTest, GetDataWithInvalidDataHandle) { url_generator_.DataBlob(kDataHandle)); } - read::VersionedLayerClient client(kHrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient client(kHrn, kLayer, olp::porting::none, + *settings_); auto request = read::DataRequest(); request.WithDataHandle(kDataHandle); diff --git a/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientPrefetchTest.cpp b/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientPrefetchTest.cpp index b7833272f..7c2010393 100644 --- a/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientPrefetchTest.cpp +++ b/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientPrefetchTest.cpp @@ -44,7 +44,7 @@ TEST_F(VersionedLayerClientPrefetchTest, PrefetchTiles) { const auto root_tile = olp::geo::TileKey::FromHereTile(kTileId); auto client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); std::vector tiles_data; tiles_data.reserve(4); @@ -199,7 +199,7 @@ TEST_F(VersionedLayerClientPrefetchTest, PrefetchPartitions) { const auto data = mockserver::ReadDefaultResponses::GenerateData(); auto client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); { SCOPED_TRACE("Prefetch partitions"); diff --git a/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientProtectTest.cpp b/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientProtectTest.cpp index fc571778d..88c4182ff 100644 --- a/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientProtectTest.cpp +++ b/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientProtectTest.cpp @@ -92,7 +92,7 @@ TEST_F(VersionedLayerClientProtectTest, ProtectAndReleaseWithEviction) { } auto client = std::make_unique( - hrn, kLayer, boost::none, *settings_); + hrn, kLayer, olp::porting::none, *settings_); auto check_if_tiles_cached = [&](const std::vector& tiles, bool expected_result) { @@ -257,7 +257,7 @@ TEST_F(VersionedLayerClientProtectTest, OverlappedQuads) { const auto base_tile = olp::geo::TileKey::FromHereTile(kTileId); auto client = std::make_unique( - hrn, kLayer, boost::none, *settings_); + hrn, kLayer, olp::porting::none, *settings_); auto check_if_quads_protected = [&](const std::vector& tiles, bool expected_result) { diff --git a/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp b/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp index dba75273b..fdd6b6eb4 100644 --- a/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp +++ b/tests/functional/olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp @@ -53,8 +53,8 @@ TEST_F(VersionedLayerClientTest, GetPartitions) { url_generator_.PartitionsMetadata()); } - auto catalog_client = - read::VersionedLayerClient(hrn, "testlayer", boost::none, *settings_); + auto catalog_client = read::VersionedLayerClient( + hrn, "testlayer", olp::porting::none, *settings_); auto request = read::PartitionsRequest(); auto future = catalog_client.GetPartitions(request); @@ -78,7 +78,7 @@ TEST_F(VersionedLayerClientTest, GetAggregatedData) { const auto request = read::TileRequest().WithTileKey(tile); // authentification not needed for the test - settings_->authentication_settings = boost::none; + settings_->authentication_settings = olp::porting::none; { SCOPED_TRACE("Requested tile"); @@ -100,7 +100,7 @@ TEST_F(VersionedLayerClientTest, GetAggregatedData) { } auto client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); auto future = client.GetAggregatedData(request).GetFuture(); auto response = future.get(); @@ -138,7 +138,7 @@ TEST_F(VersionedLayerClientTest, GetAggregatedData) { } auto client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); auto future = client.GetAggregatedData(request).GetFuture(); auto response = future.get(); @@ -176,7 +176,7 @@ TEST_F(VersionedLayerClientTest, GetAggregatedData) { } auto client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); auto future = client.GetAggregatedData(request).GetFuture(); auto response = future.get(); @@ -214,7 +214,7 @@ TEST_F(VersionedLayerClientTest, GetAggregatedData) { settings_->cache = olp::client::OlpClientSettingsFactory::CreateDefaultCache({}); auto client = - read::VersionedLayerClient(hrn, kLayer, boost::none, *settings_); + read::VersionedLayerClient(hrn, kLayer, olp::porting::none, *settings_); auto future = client.GetAggregatedData(request).GetFuture(); auto response = future.get(); diff --git a/tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientCacheTest.cpp b/tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientCacheTest.cpp index 26d08870e..d7e546763 100644 --- a/tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientCacheTest.cpp +++ b/tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientCacheTest.cpp @@ -128,7 +128,7 @@ class DataserviceWriteStreamLayerClientCacheTest : public ::testing::Test { auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId( GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; } } @@ -190,7 +190,7 @@ TEST_F(DataserviceWriteStreamLayerClientCacheTest, Queue) { auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId(GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; } TEST_F(DataserviceWriteStreamLayerClientCacheTest, QueueNullData) { @@ -210,7 +210,7 @@ TEST_F(DataserviceWriteStreamLayerClientCacheTest, QueueExtraRequestParams) { .WithTraceId(uuid) .WithBillingTag(kBillingTag)); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; } #ifdef DATASERVICE_WRITE_HAS_OPENSSL @@ -223,7 +223,7 @@ TEST_F(DataserviceWriteStreamLayerClientCacheTest, QueueWithChecksum) { .WithLayerId(GetTestLayer()) .WithChecksum(checksum)); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; } #endif @@ -231,7 +231,7 @@ TEST_F(DataserviceWriteStreamLayerClientCacheTest, FlushDataSingle) { auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId(GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; auto response = client_->Flush(model::FlushRequest()).GetFuture().get(); @@ -254,7 +254,7 @@ TEST_F(DataserviceWriteStreamLayerClientCacheTest, FlushDataSingleAsync) { auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId(GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; std::promise response_promise; bool call_is_async = true; @@ -307,7 +307,7 @@ TEST_F(DataserviceWriteStreamLayerClientCacheTest, FlushDataCancel) { auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId(GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; auto cancel_future = client_->Flush(model::FlushRequest()); diff --git a/tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientTest.cpp b/tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientTest.cpp index 85ef9c756..78008a6f3 100644 --- a/tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientTest.cpp +++ b/tests/functional/olp-cpp-sdk-dataservice-write/DataserviceWriteStreamLayerClientTest.cpp @@ -176,7 +176,7 @@ class DataserviceWriteStreamLayerClientTest : public ::testing::Test { data_->push_back(i); auto error = client_->Queue( PublishDataRequest().WithData(data_).WithLayerId(GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; } } diff --git a/tests/functional/utils/MockServerHelper.cpp b/tests/functional/utils/MockServerHelper.cpp index 3b5787e13..4578839b5 100644 --- a/tests/functional/utils/MockServerHelper.cpp +++ b/tests/functional/utils/MockServerHelper.cpp @@ -85,7 +85,7 @@ void MockServerHelper::MockGetResponse(const std::string& layer, "/query/v1/catalogs/" + catalog_ + "/layers/" + layer + "/versions/" + std::to_string(version) + "/quadkeys/" + tile.ToHereTile() + "/depths/4", - tree, olp::http::HttpStatusCode::OK, false, boost::none, + tree, olp::http::HttpStatusCode::OK, false, olp::porting::none, std::vector{ {"additionalFields", {"checksum,crc,dataSize,compressedDataSize"}}}); } diff --git a/tests/integration/olp-cpp-sdk-dataservice-read/CatalogClientCacheTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-read/CatalogClientCacheTest.cpp index a72cb4ad0..e74233d2d 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-read/CatalogClientCacheTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-read/CatalogClientCacheTest.cpp @@ -59,13 +59,13 @@ class CatalogClientCacheTest : public integration::CatalogClientTestBase { settings.max_memory_cache_size = 0; settings.disk_path_mutable = olp::utils::Dir::TempDirectory() + kClientTestCacheDir; - ClearCache(settings.disk_path_mutable.get()); + ClearCache(*settings.disk_path_mutable); break; } case integration::CacheType::BOTH: { settings.disk_path_mutable = olp::utils::Dir::TempDirectory() + kClientTestCacheDir; - ClearCache(settings.disk_path_mutable.get()); + ClearCache(*settings.disk_path_mutable); break; } case integration::CacheType::NONE: { diff --git a/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientCacheTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientCacheTest.cpp index ac301c93d..a95a7867e 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientCacheTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientCacheTest.cpp @@ -63,13 +63,13 @@ class VersionedLayerClientCacheTest settings.max_memory_cache_size = 0; settings.disk_path_mutable = olp::utils::Dir::TempDirectory() + kClientTestCacheDir; - ClearCache(settings.disk_path_mutable.get()); + ClearCache(*settings.disk_path_mutable); break; } case CacheType::BOTH: { settings.disk_path_mutable = olp::utils::Dir::TempDirectory() + kClientTestCacheDir; - ClearCache(settings.disk_path_mutable.get()); + ClearCache(*settings.disk_path_mutable); break; } case CacheType::NONE: { @@ -121,7 +121,7 @@ TEST_P(VersionedLayerClientCacheTest, GetDataWithPartitionId) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, settings_); + hrn, "testlayer", olp::porting::none, settings_); auto request = olp::dataservice::read::DataRequest(); request.WithPartitionId("269"); @@ -168,7 +168,7 @@ TEST_P(VersionedLayerClientCacheTest, GetPartitionsLayerVersions) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, settings_); + hrn, "testlayer", olp::porting::none, settings_); auto request = olp::dataservice::read::PartitionsRequest(); auto future = catalog_client->GetPartitions(request); @@ -194,7 +194,7 @@ TEST_P(VersionedLayerClientCacheTest, GetPartitions) { auto catalog_client = std::make_unique( - hrn, "testlayer", boost::none, settings_); + hrn, "testlayer", olp::porting::none, settings_); auto request = olp::dataservice::read::PartitionsRequest(); auto future = catalog_client->GetPartitions(request); @@ -246,7 +246,7 @@ TEST_P(VersionedLayerClientCacheTest, GetDataWithPartitionIdDifferentVersions) { auto catalog_client_1 = std::make_unique( - hrn, "testlayer", boost::none, settings_); + hrn, "testlayer", olp::porting::none, settings_); auto catalog_client_2 = std::make_unique( diff --git a/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientPrefetchPartitionsTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientPrefetchPartitionsTest.cpp index 681f38472..7ba4404c1 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientPrefetchPartitionsTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientPrefetchPartitionsTest.cpp @@ -63,8 +63,8 @@ std::vector GeneratePartitionIds(size_t partitions_count) { TEST_F(VersionedLayerClientPrefetchPartitionsTest, PrefetchPartitions) { auto partitions_count = 3u; - auto client = - read::VersionedLayerClient(kCatalogHrn, kLayer, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalogHrn, kLayer, + olp::porting::none, settings_); auto partitions = GeneratePartitionIds(partitions_count); auto partitions_response = ReadDefaultResponses::GeneratePartitionsResponse(partitions_count); @@ -164,8 +164,8 @@ TEST_F(VersionedLayerClientPrefetchPartitionsTest, PrefetchPartitions) { TEST_F(VersionedLayerClientPrefetchPartitionsTest, PrefetchPartitionsFails) { auto partitions_count = 3u; - auto client = - read::VersionedLayerClient(kCatalogHrn, kLayer, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalogHrn, kLayer, + olp::porting::none, settings_); auto partitions = GeneratePartitionIds(partitions_count); auto partitions_response = ReadDefaultResponses::GeneratePartitionsResponse(partitions_count); @@ -293,8 +293,8 @@ TEST_F(VersionedLayerClientPrefetchPartitionsTest, PrefetchBatchFails) { TEST_F(VersionedLayerClientPrefetchPartitionsTest, PrefetchPartitionsCancel) { auto partitions_count = 1u; - auto client = - read::VersionedLayerClient(kCatalogHrn, kLayer, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalogHrn, kLayer, + olp::porting::none, settings_); auto partitions = GeneratePartitionIds(partitions_count); auto partitions_response = ReadDefaultResponses::GeneratePartitionsResponse(partitions_count); @@ -326,8 +326,8 @@ TEST_F(VersionedLayerClientPrefetchPartitionsTest, CheckPriority) { // this priority should be less than priority, but greater than LOW auto finish_task_priority = 200u; auto partitions_count = 3u; - auto client = - read::VersionedLayerClient(kCatalogHrn, kLayer, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalogHrn, kLayer, + olp::porting::none, settings_); auto partitions = GeneratePartitionIds(partitions_count); auto partitions_response = ReadDefaultResponses::GeneratePartitionsResponse(partitions_count); diff --git a/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp index 0e1f91af8..3d8148999 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp @@ -452,7 +452,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, auto sync_settings = settings_; sync_settings.task_scheduler.reset(); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, sync_settings); + kCatalog, kTestLayer, olp::porting::none, sync_settings); DataResponse response; @@ -475,7 +475,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, auto sync_settings = settings_; sync_settings.task_scheduler.reset(); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, sync_settings); + kCatalog, kTestLayer, olp::porting::none, sync_settings); DataResponse response; @@ -861,7 +861,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, DataRequestPriority) { TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsNoError) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::PartitionsRequest(); auto promise = std::make_shared>(); @@ -884,7 +884,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsNoError) { TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsCancellableFutureNoError) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::PartitionsRequest(); auto cancellable_future = client->GetPartitions(request); @@ -902,7 +902,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, []() { std::this_thread::sleep_for(std::chrono::seconds(1)); }); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::PartitionsRequest(); auto cancellable_future = client->GetPartitions(request); @@ -923,7 +923,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetEmptyPartitions) { HTTP_RESPONSE_EMPTY_PARTITIONS)); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::PartitionsRequest(); auto promise = std::make_shared>(); @@ -958,7 +958,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitions429Error) { }; settings_.retry_settings = retry_settings; auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::PartitionsRequest(); auto promise = std::make_shared>(); @@ -993,7 +993,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, ApiLookup429) { }; settings_.retry_settings = retry_settings; auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::PartitionsRequest(); auto promise = std::make_shared>(); @@ -1012,7 +1012,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsForInvalidLayer) { const auto layer = "somewhat_not_okay"; auto client = std::make_shared( - kCatalog, layer, boost::none, settings_); + kCatalog, layer, olp::porting::none, settings_); auto request = read::PartitionsRequest(); auto promise = std::make_shared>(); @@ -1029,7 +1029,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsForInvalidLayer) { TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsCacheWithUpdate) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); // Request 1 { @@ -1065,7 +1065,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsCacheWithUpdate) { TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitions403CacheClear) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); { testing::InSequence s; EXPECT_CALL(*network_mock_, Send(IsGetRequest(URL_PARTITIONS), _, _, _, _)) @@ -1127,7 +1127,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitions403CacheClear) { TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsGarbageResponse) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); EXPECT_CALL(*network_mock_, Send(IsGetRequest(URL_LOOKUP_API), _, _, _, _)) .WillOnce(ReturnHttpResponse(GetResponse(http::HttpStatusCode::OK), @@ -1149,7 +1149,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsGarbageResponse) { TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsCancelLookupMetadata) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); // Setup the expected calls : auto wait_for_cancel = std::make_shared>(); @@ -1199,7 +1199,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsCancelLatestCatalogVersion) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); // Setup the expected calls : auto wait_for_cancel = std::make_shared>(); @@ -1250,7 +1250,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsCancelLayerVersions) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); // Setup the expected calls : auto wait_for_cancel = std::make_shared>(); @@ -1361,7 +1361,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsInvalidVersion) { TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsCacheOnly) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); EXPECT_CALL(*network_mock_, Send(IsGetRequest(URL_PARTITIONS), _, _, _, _)) .Times(0); @@ -1381,7 +1381,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsCacheOnly) { TEST_F(DataserviceReadVersionedLayerClientTest, GetPartitionsOnlineOnly) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); { testing::InSequence s; @@ -1431,7 +1431,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchTilesWithCache) { constexpr auto kLayerId = "hype-test-prefetch"; auto client = std::make_shared( - kCatalog, kLayerId, boost::none, settings_); + kCatalog, kLayerId, olp::porting::none, settings_); { SCOPED_TRACE("Prefetch tiles online and store them in memory cache"); @@ -1518,7 +1518,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, constexpr auto kLayerId = "hype-test-prefetch"; auto client = std::make_shared( - kCatalog, kLayerId, boost::none, settings_); + kCatalog, kLayerId, olp::porting::none, settings_); { SCOPED_TRACE("Prefetch tiles where tile greater min level"); @@ -1610,7 +1610,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, constexpr auto kLayerId = "hype-test-prefetch"; auto client = std::make_shared( - kCatalog, kLayerId, boost::none, settings_); + kCatalog, kLayerId, olp::porting::none, settings_); { SCOPED_TRACE("Prefetch tiles online, "); @@ -1664,7 +1664,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, const auto requested_tile = geo::TileKey::FromHereTile("23618365"); - read::VersionedLayerClient client(kCatalog, kLayerId, boost::none, settings_); + read::VersionedLayerClient client(kCatalog, kLayerId, olp::porting::none, + settings_); { SCOPED_TRACE("Prefetch aggregated tile"); @@ -1717,7 +1718,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, const auto requested_tile = geo::TileKey::FromHereTile("23618365"); - read::VersionedLayerClient client(kCatalog, kLayerId, boost::none, settings_); + read::VersionedLayerClient client(kCatalog, kLayerId, olp::porting::none, + settings_); { SCOPED_TRACE("Prefetch aggregated tile"); @@ -1815,7 +1817,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, constexpr auto kParitionId = "prefetch-partition"; auto client = std::make_shared( - kCatalog, kLayerId, boost::none, settings_); + kCatalog, kLayerId, olp::porting::none, settings_); std::vector tile_keys = { geo::TileKey::FromHereTile(kParitionId)}; @@ -1863,7 +1865,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchTilesCancelOnLookup) { constexpr auto kParitionId = "prefetch-partition"; auto client = std::make_shared( - kCatalog, kLayerId, boost::none, settings_); + kCatalog, kLayerId, olp::porting::none, settings_); std::vector tile_keys = { geo::TileKey::FromHereTile(kParitionId)}; @@ -1899,7 +1901,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, .WithMaxLevel(12); auto client = std::make_shared( - kCatalog, kLayerId, boost::none, settings_); + kCatalog, kLayerId, olp::porting::none, settings_); auto cancel_future = client->PrefetchTiles(request); auto raw_future = cancel_future.GetFuture(); @@ -1929,7 +1931,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, .WithMaxLevel(12); auto client = std::make_shared( - kCatalog, kLayerId, boost::none, settings_); + kCatalog, kLayerId, olp::porting::none, settings_); auto wait_for_cancel = std::make_shared>(); auto pause_for_cancel = std::make_shared>(); @@ -1962,8 +1964,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchTilesInvalidResponse) { constexpr auto kLayerId = "hype-test-prefetch"; - auto client = - read::VersionedLayerClient(kCatalog, kLayerId, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalog, kLayerId, + olp::porting::none, settings_); std::vector tile_keys = {geo::TileKey::FromHereTile("5904591")}; auto request = read::PrefetchTilesRequest() @@ -1995,8 +1997,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchTilesInvalidResponse) { TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchTilesEmptyResponse) { constexpr auto kLayerId = "hype-test-prefetch"; - auto client = - read::VersionedLayerClient(kCatalog, kLayerId, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalog, kLayerId, + olp::porting::none, settings_); std::vector tile_keys = { geo::TileKey::FromHereTile("23618365")}; @@ -2028,8 +2030,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchTilesEmptyResponseDefaultLevels) { constexpr auto kLayerId = "hype-test-prefetch"; - auto client = - read::VersionedLayerClient(kCatalog, kLayerId, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalog, kLayerId, + olp::porting::none, settings_); std::vector tile_keys = { geo::TileKey::FromHereTile("23618365")}; @@ -2064,8 +2066,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchSameTiles) { constexpr auto kLayerId = "hype-test-prefetch"; - auto client = - read::VersionedLayerClient(kCatalog, kLayerId, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalog, kLayerId, + olp::porting::none, settings_); std::vector tile_keys = {geo::TileKey::FromHereTile("5904591")}; auto request = read::PrefetchTilesRequest() @@ -2128,8 +2130,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchSameTiles) { TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchTilesWithStatus) { constexpr auto kLayerId = "hype-test-prefetch"; - auto client = - read::VersionedLayerClient(kCatalog, kLayerId, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalog, kLayerId, + olp::porting::none, settings_); std::vector tile_keys = {geo::TileKey::FromHereTile("5904591")}; auto request = read::PrefetchTilesRequest() @@ -2217,8 +2219,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchPriority) { scheduler->ScheduleTask([&]() { block_future.wait_for(kWaitTimeout); }, std::numeric_limits::max()); - auto client = - read::VersionedLayerClient(kCatalog, kLayerId, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalog, kLayerId, + olp::porting::none, settings_); std::vector tile_keys = {geo::TileKey::FromHereTile("5904591")}; auto priority = 300u; @@ -2274,7 +2276,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetData404Error) { "Resource not found.")); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithDataHandle("invalidDataHandle"); @@ -2309,7 +2311,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetData429Error) { }; settings_.retry_settings = retry_settings; auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithDataHandle("4eed6ed1-0d32-43b9-ae79-043cb4256432"); @@ -2339,7 +2341,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetData403CacheClear) { } auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition); // Populate cache @@ -2362,7 +2364,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetData403CacheClear) { TEST_F(DataserviceReadVersionedLayerClientTest, GetDataCacheWithUpdate) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition) .WithFetchOption(FetchOptions::CacheWithUpdate); @@ -2384,7 +2386,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataCacheWithUpdate) { TEST_F(DataserviceReadVersionedLayerClientTest, CancelPendingRequestsPartitions) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto partitions_request = PartitionsRequest().WithFetchOption(FetchOptions::OnlineOnly); auto data_request = read::DataRequest() @@ -2442,7 +2444,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, TEST_F(DataserviceReadVersionedLayerClientTest, CancelPendingRequestsPrefetch) { auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto prefetch_request = PrefetchTilesRequest(); auto data_request = read::DataRequest() .WithPartitionId(kTestPartition) @@ -2526,7 +2528,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, .Times(0); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition); @@ -2580,7 +2582,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, .Times(0); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition); @@ -2634,7 +2636,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, .Times(0); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition); @@ -2685,7 +2687,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, .WillOnce(testing::Invoke(std::move(cancel_mock))); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition); @@ -2738,7 +2740,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, .Times(0); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition); @@ -2788,7 +2790,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, .WillOnce(testing::Invoke(std::move(cancel_mock))); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition); @@ -2861,7 +2863,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataCacheOnly) { EXPECT_CALL(*network_mock_, Send(IsGetRequest(URL_BLOB_DATA_269), _, _, _, _)) .Times(0); auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition) @@ -2889,7 +2891,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetDataOnlineOnly) { } auto client = std::make_shared( - kCatalog, kTestLayer, boost::none, settings_); + kCatalog, kTestLayer, olp::porting::none, settings_); auto request = read::DataRequest(); request.WithPartitionId(kTestPartition) @@ -3281,7 +3283,7 @@ TEST_F(DataserviceReadVersionedLayerClientTest, CheckIfPartitionCached) { } { SCOPED_TRACE("Client without version can't check"); - read::VersionedLayerClient client(kCatalog, kTestLayer, boost::none, + read::VersionedLayerClient client(kCatalog, kTestLayer, olp::porting::none, settings_); EXPECT_FALSE(client.IsCached(kTestPartition)); } @@ -4157,8 +4159,8 @@ TEST_F(DataserviceReadVersionedLayerClientTest, GetTileAndAggregatedData) { TEST_F(DataserviceReadVersionedLayerClientTest, PrefetchTilesAndGetAggregated) { constexpr auto kLayerId = "hype-test-prefetch"; - auto client = - read::VersionedLayerClient(kCatalog, kLayerId, boost::none, settings_); + auto client = read::VersionedLayerClient(kCatalog, kLayerId, + olp::porting::none, settings_); { SCOPED_TRACE("Prefetch tiles online and store them in memory cache"); diff --git a/tests/integration/olp-cpp-sdk-dataservice-read/VolatileLayerClientCacheTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-read/VolatileLayerClientCacheTest.cpp index 1fb8b81fd..8ac36dc1b 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-read/VolatileLayerClientCacheTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-read/VolatileLayerClientCacheTest.cpp @@ -64,13 +64,13 @@ class VolatileLayerClientCacheTest : public integration::CatalogClientTestBase { settings.max_memory_cache_size = 0; settings.disk_path_mutable = olp::utils::Dir::TempDirectory() + kClientTestCacheDir; - ClearCache(settings.disk_path_mutable.get()); + ClearCache(*settings.disk_path_mutable); break; } case integration::CacheType::BOTH: { settings.disk_path_mutable = olp::utils::Dir::TempDirectory() + kClientTestCacheDir; - ClearCache(settings.disk_path_mutable.get()); + ClearCache(*settings.disk_path_mutable); break; } case integration::CacheType::NONE: { diff --git a/tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientCacheTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientCacheTest.cpp index 030b025b8..cabe4d6d6 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientCacheTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientCacheTest.cpp @@ -128,7 +128,7 @@ class StreamLayerClientCacheTest : public ::testing::Test { auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId( GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; } } @@ -233,14 +233,15 @@ class StreamLayerClientCacheTest : public ::testing::Test { } void FlushDataOnSettingSuccessAssertions( - const boost::optional& max_events_per_flush = boost::none) { + const olp::porting::optional& max_events_per_flush = + olp::porting::none) { for (int i = 0; i < 5; i++) { data_->push_back(' '); data_->push_back(i); auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId( GetTestLayer())); - EXPECT_FALSE(error) << error.get(); + EXPECT_FALSE(error) << *error; } const auto num_requests_to_flush = @@ -324,7 +325,7 @@ TEST_F(StreamLayerClientCacheTest, FlushDataSingle) { auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId(GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; auto response = client_->Flush(model::FlushRequest()).GetFuture().get(); @@ -405,7 +406,7 @@ TEST_F(StreamLayerClientCacheTest, FlushDataCancel) { kHrn, write::StreamLayerClientSettings{}, client_settings); auto error = client->Queue(publish_request); - EXPECT_FALSE(error) << error.get(); + EXPECT_FALSE(error) << *error; auto promise = client->Flush(model::FlushRequest()); wait_for_cancel->get_future().get(); @@ -432,7 +433,7 @@ TEST_F(StreamLayerClientCacheTest, FlushDataCancel) { kHrn, write::StreamLayerClientSettings{}, client_settings); auto error = client->Queue(publish_request); - EXPECT_FALSE(error) << error.get(); + EXPECT_FALSE(error) << *error; auto promise = client->Flush(model::FlushRequest()); wait_for_cancel->get_future().get(); diff --git a/tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientTest.cpp index 7bf186ae2..0b6db7710 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-write/StreamLayerClientTest.cpp @@ -140,7 +140,7 @@ class StreamLayerClientTest : public ::testing::Test { auto error = client_->Queue( model::PublishDataRequest().WithData(data_).WithLayerId( GetTestLayer())); - ASSERT_FALSE(error) << error.get(); + ASSERT_FALSE(error) << *error; } } diff --git a/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientPublishToBatchTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientPublishToBatchTest.cpp index 4fcb7215c..74e5c8504 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientPublishToBatchTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientPublishToBatchTest.cpp @@ -132,7 +132,7 @@ class VersionedLayerClientPublishToBatchTest : public ::testing::Test { int status = olp::http::HttpStatusCode::NO_CONTENT) { auto api = MockApiRequest("publish"); const std::string url = api.GetBaseUrl() + "/layers/" + layer + - "/publications/" + publication.GetId().get() + + "/publications/" + *publication.GetId() + "/partitions"; EXPECT_CALL(*network_, Send(IsPostRequest(url), _, _, _, _)) diff --git a/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientTest.cpp b/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientTest.cpp index 947d58d93..2389ad6f3 100644 --- a/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientTest.cpp +++ b/tests/integration/olp-cpp-sdk-dataservice-write/VersionedLayerClientTest.cpp @@ -149,8 +149,8 @@ TEST_F(VersionedLayerClientTest, StartBatch) { ASSERT_TRUE(result.GetId()); ASSERT_TRUE(result.GetDetails()); ASSERT_TRUE(result.GetLayerIds()); - ASSERT_EQ(result.GetLayerIds().get().size(), 1); - ASSERT_EQ(result.GetLayerIds().get().front(), kLayer); + ASSERT_EQ(result.GetLayerIds()->size(), 1); + ASSERT_EQ(result.GetLayerIds()->front(), kLayer); ASSERT_NE("", response.GetResult().GetId().value()); Mock::VerifyAndClearExpectations(network_.get()); } @@ -182,8 +182,8 @@ TEST_F(VersionedLayerClientTest, StartBatch) { ASSERT_TRUE(result.GetId()); ASSERT_TRUE(result.GetDetails()); ASSERT_TRUE(result.GetLayerIds()); - ASSERT_EQ(result.GetLayerIds().get().size(), 1); - ASSERT_EQ(result.GetLayerIds().get().front(), kLayer); + ASSERT_EQ(result.GetLayerIds()->size(), 1); + ASSERT_EQ(result.GetLayerIds()->front(), kLayer); ASSERT_NE("", response.GetResult().GetId().value()); Mock::VerifyAndClearExpectations(network_.get()); } @@ -358,8 +358,7 @@ TEST_F(VersionedLayerClientTest, CompleteBatch) { ASSERT_FALSE(api.empty()); ASSERT_TRUE(publication.GetId()); - const auto publication_publish_url = - kPublishUrl + "/" + publication.GetId().get(); + const auto publication_publish_url = kPublishUrl + "/" + *publication.GetId(); // auth token should be valid till the end of all tests EXPECT_CALL( @@ -572,7 +571,7 @@ TEST_F(VersionedLayerClientTest, CancelBatch) { const auto publication = mockserver::DefaultResponses::GeneratePublicationResponse({kLayer}, {}); ASSERT_TRUE(publication.GetId()); - const auto publication_url = kCancelBatchBaseUrl + publication.GetId().get(); + const auto publication_url = kCancelBatchBaseUrl + *publication.GetId(); // auth token should be valid till the end of all test cases EXPECT_CALL( diff --git a/tests/performance/MemoryTest.cpp b/tests/performance/MemoryTest.cpp index 80ce99c18..21ef58ba2 100644 --- a/tests/performance/MemoryTest.cpp +++ b/tests/performance/MemoryTest.cpp @@ -18,10 +18,10 @@ */ #include -#include -#include #include +#include #include +#include #include #include @@ -205,7 +205,7 @@ TEST_P(MemoryTest, ReadNPartitionsFromVersionedLayer) { StartThreads([=](uint8_t /*thread_id*/) { olp::dataservice::read::VersionedLayerClient service_client( - kCatalog, kVersionedLayerId, boost::none, settings); + kCatalog, kVersionedLayerId, olp::porting::none, settings); const auto end_timestamp = std::chrono::steady_clock::now() + parameter.runtime; diff --git a/tests/performance/PrefetchTest.cpp b/tests/performance/PrefetchTest.cpp index 8efafb520..df8608809 100644 --- a/tests/performance/PrefetchTest.cpp +++ b/tests/performance/PrefetchTest.cpp @@ -135,7 +135,7 @@ TEST_P(PrefetchTest, PrefetchPartitionsFromVersionedLayer) { StartThreads([=](uint8_t thread_id) { olp::dataservice::read::VersionedLayerClient service_client( - kCatalog, kVersionedLayerId, boost::none, settings); + kCatalog, kVersionedLayerId, olp::porting::none, settings); const auto level = 10; diff --git a/tests/utils/mock-server-client/Client.h b/tests/utils/mock-server-client/Client.h index 9f15e0c8b..1787e5da1 100644 --- a/tests/utils/mock-server-client/Client.h +++ b/tests/utils/mock-server-client/Client.h @@ -49,9 +49,9 @@ class Client { const std::string& method_matcher, const std::string& path_matcher, const std::string& response_body, int https_status = olp::http::HttpStatusCode::OK, bool unlimited = false, - boost::optional delay_ms = boost::none, - boost::optional> - query_params = boost::none); + olp::porting::optional delay_ms = olp::porting::none, + olp::porting::optional> + query_params = olp::porting::none); void MockBinaryResponse(const std::string& method_matcher, const std::string& path_matcher, @@ -81,24 +81,24 @@ inline Client::Client(olp::client::OlpClientSettings settings) { inline void Client::MockResponse( const std::string& method_matcher, const std::string& path_matcher, const std::string& response_body, int https_status, bool unlimited, - boost::optional delay_ms, - boost::optional> + olp::porting::optional delay_ms, + olp::porting::optional> query_params) { auto expectation = Expectation{}; expectation.request.path = path_matcher; expectation.request.method = method_matcher; expectation.request.query_string_parameters = std::move(query_params); - boost::optional action = + olp::porting::optional action = Expectation::ResponseAction{}; action->body = response_body; action->status_code = static_cast(https_status); if (delay_ms) { - action->delay = {{delay_ms.get(), "MILLISECONDS"}}; + action->delay = {{*delay_ms, "MILLISECONDS"}}; } expectation.action = action; - boost::optional times = + olp::porting::optional times = Expectation::ResponseTimes{}; times->remaining_times = 1; times->unlimited = unlimited; @@ -117,12 +117,12 @@ inline void Client::MockBinaryResponse(const std::string& method_matcher, auto binary_response = Expectation::BinaryResponse{}; binary_response.base64_string = response_body; - boost::optional action = + olp::porting::optional action = Expectation::ResponseAction{}; action->body = binary_response; expectation.action = action; - boost::optional times = + olp::porting::optional times = Expectation::ResponseTimes{}; times->remaining_times = 1; times->unlimited = false; diff --git a/tests/utils/mock-server-client/Expectation.h b/tests/utils/mock-server-client/Expectation.h index c263574bf..e56d31578 100644 --- a/tests/utils/mock-server-client/Expectation.h +++ b/tests/utils/mock-server-client/Expectation.h @@ -22,8 +22,8 @@ #include #include -#include +#include #include "JsonHelpers.h" namespace mockserver { @@ -34,10 +34,10 @@ struct Expectation { std::vector values; }; struct RequestMatcher { - boost::optional path = boost::none; - boost::optional method = boost::none; - boost::optional> query_string_parameters = - boost::none; + olp::porting::optional path = olp::porting::none; + olp::porting::optional method = olp::porting::none; + olp::porting::optional> + query_string_parameters = olp::porting::none; }; struct ResponseDelay { @@ -46,8 +46,8 @@ struct Expectation { }; struct ResponseAction { - boost::optional delay = boost::none; - boost::optional status_code = boost::none; + olp::porting::optional delay = olp::porting::none; + olp::porting::optional status_code = olp::porting::none; /// Any of BinaryResponse, std::string, boost::any boost::any body; @@ -64,8 +64,8 @@ struct Expectation { }; RequestMatcher request; - boost::optional action = boost::none; - boost::optional times = boost::none; + olp::porting::optional action = olp::porting::none; + olp::porting::optional times = olp::porting::none; }; void to_json(const Expectation& x, rapidjson::Value& value, @@ -91,10 +91,10 @@ inline void to_json(const Expectation& x, rapidjson::Value& value, value.SetObject(); serialize("httpRequest", x.request, value, allocator); - if (x.action != boost::none) { + if (x.action != olp::porting::none) { serialize("httpResponse", x.action, value, allocator); } - if (x.times != boost::none) { + if (x.times != olp::porting::none) { serialize("times", x.times, value, allocator); } } @@ -147,7 +147,7 @@ inline void to_json(const Expectation::ResponseAction& x, } if (x.delay) { - serialize("delay", x.delay.get(), value, allocator); + serialize("delay", *x.delay, value, allocator); } } diff --git a/tests/utils/mock-server-client/JsonHelpers.h b/tests/utils/mock-server-client/JsonHelpers.h index d2756f939..fe529f536 100644 --- a/tests/utils/mock-server-client/JsonHelpers.h +++ b/tests/utils/mock-server-client/JsonHelpers.h @@ -22,9 +22,9 @@ #include #include +#include #include #include -#include namespace mockserver { @@ -61,10 +61,10 @@ inline void to_json(const std::shared_ptr>& x, } template -inline void to_json(const boost::optional& x, rapidjson::Value& value, +inline void to_json(const olp::porting::optional& x, rapidjson::Value& value, rapidjson::Document::AllocatorType& allocator) { if (x) { - to_json(x.get(), value, allocator); + to_json(*x, value, allocator); } else { value.SetNull(); }