Skip to content

Commit c3501a4

Browse files
authored
Add integration tests for StreamLayerClient Subscribe (#601)
Resolves: OLPEDGE-1469 Signed-off-by: Dmytro Poberezhnyi <[email protected]>
1 parent 784e2b2 commit c3501a4

File tree

3 files changed

+547
-0
lines changed

3 files changed

+547
-0
lines changed

tests/integration/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ set(OLP_SDK_INTEGRATIONAL_TESTS_SOURCES
2424
./olp-cpp-sdk-dataservice-read/CatalogClientTestBase.cpp
2525
./olp-cpp-sdk-dataservice-read/CatalogClientTest.cpp
2626
./olp-cpp-sdk-dataservice-read/HttpResponses.h
27+
./olp-cpp-sdk-dataservice-read/StreamLayerClientTest.cpp
2728
./olp-cpp-sdk-dataservice-read/VersionedLayerClientTest.cpp
2829
./olp-cpp-sdk-dataservice-read/VolatileLayerClientTest.cpp
2930
./olp-cpp-sdk-dataservice-write/HttpResponses.h

tests/integration/olp-cpp-sdk-dataservice-read/HttpResponses.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,27 @@
9090
#define URL_PARTITION_3 \
9191
R"(https://query.data.api.platform.here.com/query/v1/catalogs/hereos-internal-test-v2/layers/testlayer/partitions?partition=3&version=4)"
9292

93+
#define URL_STREAM_SUBSCRIBE_SERIAL \
94+
R"(https://stream-ireland.data.api.platform.here.com/stream/v2/catalogs/hereos-internal-test-v2/layers/testlayer/subscribe?mode=serial)"
95+
96+
#define URL_STREAM_SUBSCRIBE_PARALLEL \
97+
R"(https://stream-ireland.data.api.platform.here.com/stream/v2/catalogs/hereos-internal-test-v2/layers/testlayer/subscribe?mode=parallel)"
98+
99+
#define URL_STREAM_SUBSCRIBE_SUBSCRIPTION_ID \
100+
R"(https://stream-ireland.data.api.platform.here.com/stream/v2/catalogs/hereos-internal-test-v2/layers/testlayer/subscribe?mode=serial&subscriptionId=subscribe_id_12345)"
101+
102+
#define URL_STREAM_SUBSCRIBE_CONSUMER_ID \
103+
R"(https://stream-ireland.data.api.platform.here.com/stream/v2/catalogs/hereos-internal-test-v2/layers/testlayer/subscribe?consumerId=consumer_id_1234&mode=serial)"
104+
105+
#define URL_STREAM_SUBSCRIBE_ALL_PARAMETERS \
106+
R"(https://stream-ireland.data.api.platform.here.com/stream/v2/catalogs/hereos-internal-test-v2/layers/testlayer/subscribe?consumerId=consumer_id_1234&mode=parallel&subscriptionId=subscribe_id_12345)"
107+
93108
#define URL_LOOKUP_VOLATILE_BLOB \
94109
R"(https://api-lookup.data.api.platform.here.com/lookup/v1/resources/)"+GetTestCatalog()+R"(/apis/volatile-blob/v1)"
95110

111+
#define URL_LOOKUP_STREAM \
112+
R"(https://api-lookup.data.api.platform.here.com/lookup/v1/resources/)"+GetTestCatalog()+R"(/apis/stream/v2)"
113+
96114
#define CONFIG_BASE_URL "https://config.data.api.platform.in.here.com/config/v1"
97115

98116
#define HTTP_RESPONSE_LOOKUP_CONFIG \
@@ -108,6 +126,9 @@
108126
#define HTTP_RESPONSE_LOOKUP_BLOB \
109127
R"jsonString([{"api":"blob","version":"v1","baseURL":"https://blob-ireland.data.api.platform.here.com/blobstore/v1/catalogs/hereos-internal-test-v2","parameters":{}}])jsonString"
110128

129+
#define HTTP_RESPONSE_LOOKUP_STREAM \
130+
R"jsonString([{"api":"stream","version":"v1","baseURL":"https://stream-ireland.data.api.platform.here.com/stream/v2/catalogs/hereos-internal-test-v2","parameters":{}}])jsonString"
131+
111132
#define HTTP_RESPONSE_LOOKUP_VOLATILE_BLOB \
112133
R"jsonString([{"api":"volatile-blob","version":"v1","baseURL":"https://volatile-blob-ireland.data.api.platform.here.com/blobstore/v1/catalogs/hereos-internal-test-v2","parameters":{}}])jsonString"
113134

@@ -117,6 +138,12 @@
117138
#define HTTP_RESPONSE_403 \
118139
R"jsonString("Forbidden - A catalog with the specified HRN doesn't exist or access to this catalog is forbidden)jsonString"
119140

141+
#define HTTP_RESPONSE_SUBSCRIBE_403 \
142+
R"jsonString({ "error": "Forbidden Error", "error_description": "Error description" })jsonString"
143+
144+
#define HTTP_RESPONSE_SUBSCRIBE_404 \
145+
R"jsonString({ "title": "Stream layer not found", "status": 404, "code": "E213016", "cause": "Stream layer for catalog=hrn:here:data::olp-here-test:hereos-internal-test-v2","action": "Verify stream layer name and existence, and retry", "correlationId": "correlationId_12345"})jsonString"
146+
120147
#define HTTP_RESPONSE_LATEST_CATALOG_VERSION \
121148
R"jsonString({"version":4})jsonString"
122149

@@ -157,6 +184,9 @@
157184
#define HTTP_RESPONSE_INVALID_LAYER \
158185
R"jsonString({"title":"Bad Request","detail":[{"name":"layer","error":"Layer 'somewhat_not_okay' is missing in the catalog configuration."}],"status":400})jsonString"
159186

187+
#define HTTP_RESPONSE_STREAM_LAYER_SUBSCRIPTION \
188+
R"jsonString({ "nodeBaseURL": "https://some.stream.url/stream/v2/catalogs/hrn:here:data::olp-here-test:hereos-internal-test-v2", "subscriptionId": "subscribe_id_12345" })jsonString"
189+
160190
// <PREFETCH URLs and RESPONSEs>
161191
#define URL_CONFIG_V2 \
162192
R"(https://config.data.api.platform.here.com/config/v1/catalogs/)"+GetTestCatalog()

0 commit comments

Comments
 (0)