From fb93148134ecff05dda62c81bc29bbc4c172203d Mon Sep 17 00:00:00 2001 From: Hossam Hindawy Date: Thu, 5 Feb 2026 17:12:11 +0200 Subject: [PATCH 1/7] [CDX-358] Handle undeliverable RxJava exceptions --- .../java/io/constructor/core/ConstructorIo.kt | 33 +++++++++++++++++++ .../injection/module/NetworkModule.kt | 3 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/library/src/main/java/io/constructor/core/ConstructorIo.kt b/library/src/main/java/io/constructor/core/ConstructorIo.kt index fe19e68e..d0793d1a 100755 --- a/library/src/main/java/io/constructor/core/ConstructorIo.kt +++ b/library/src/main/java/io/constructor/core/ConstructorIo.kt @@ -33,7 +33,10 @@ import io.constructor.util.urlEncode import io.reactivex.Completable import io.reactivex.Observable import io.reactivex.disposables.CompositeDisposable +import io.reactivex.exceptions.UndeliverableException +import io.reactivex.plugins.RxJavaPlugins import io.reactivex.schedulers.Schedulers +import java.io.IOException import java.util.* typealias ConstructorError = ((Throwable) -> Unit)? @@ -110,6 +113,10 @@ object ConstructorIo { } this.context = context.applicationContext + // Set up RxJava global error handler to prevent crashes from undeliverable exceptions. + // This handles network errors that occur after the RxJava chain has completed/disposed. + setupRxJavaErrorHandler() + configMemoryHolder = component.configMemoryHolder() configMemoryHolder.autocompleteResultCount = constructorIoConfig.autocompleteResultCount configMemoryHolder.testCellParams = constructorIoConfig.testCells @@ -131,6 +138,32 @@ object ConstructorIo { dataManager = component.dataManager() } + /** + * Sets up a global RxJava error handler to gracefully handle undeliverable exceptions. + * These exceptions can occur when network errors happen after the RxJava stream has + * already completed or been disposed, particularly with OkHttp async operations. + */ + private fun setupRxJavaErrorHandler() { + RxJavaPlugins.setErrorHandler { throwable -> + var error = throwable + // Unwrap the actual cause from UndeliverableException + if (error is UndeliverableException) { + error = error.cause ?: error + } + + // Network exceptions are expected during normal operation (timeout, no connectivity, etc.) + // Log them but don't crash the app + if (error is IOException || error is InterruptedException) { + e("Constructor.io: Non-fatal network error: ${error.javaClass.simpleName} - ${error.message}") + return@setErrorHandler + } + + // For other unexpected exceptions, log them as errors + // but still don't crash - these shouldn't bring down the host app + e("Constructor.io: Undeliverable exception: ${error.javaClass.simpleName} - ${error.message}") + } + } + /** * Returns the current session identifier (an incrementing integer) */ diff --git a/library/src/main/java/io/constructor/injection/module/NetworkModule.kt b/library/src/main/java/io/constructor/injection/module/NetworkModule.kt index daab84c9..8ae39f04 100755 --- a/library/src/main/java/io/constructor/injection/module/NetworkModule.kt +++ b/library/src/main/java/io/constructor/injection/module/NetworkModule.kt @@ -9,6 +9,7 @@ import io.constructor.data.local.PreferencesHelper import io.constructor.data.memory.ConfigMemoryHolder import io.constructor.data.model.dataadapter.ResultDataAdapter import io.constructor.injection.ConstructorSdk +import io.reactivex.schedulers.Schedulers import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit @@ -33,7 +34,7 @@ object NetworkModule { .baseUrl(preferencesHelper.scheme + "://" + preferencesHelper.serviceUrl) .client(okHttpClient) .addConverterFactory(MoshiConverterFactory.create(moshi)) - .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + .addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io())) .build() @Provides From c9379206d4034b1d3ba014ce48d327428ea2d9a9 Mon Sep 17 00:00:00 2001 From: Hossam Hindawy Date: Thu, 5 Feb 2026 17:14:12 +0200 Subject: [PATCH 2/7] Version Bump --- README.md | 2 +- library/build.gradle | 2 +- .../core/ConstructorIoAutocompleteTest.kt | 24 +-- .../core/ConstructorIoRecommendationsTest.kt | 18 +-- .../core/ConstructorIoTrackingTest.kt | 138 +++++++++--------- .../ConstructorioBrowseFacetOptionsTest.kt | 6 +- .../core/ConstructorioBrowseFacetsTest.kt | 6 +- .../core/ConstructorioBrowseGroupsTest.kt | 6 +- .../core/ConstructorioBrowseItemsTest.kt | 22 +-- .../core/ConstructorioBrowseTest.kt | 32 ++-- .../constructor/core/ConstructorioQuizTest.kt | 26 ++-- .../core/ConstructorioSearchTest.kt | 34 ++--- .../core/ConstructorioSegmentsTest.kt | 22 +-- .../core/ConstructorioTestCellTest.kt | 22 +-- 14 files changed, 180 insertions(+), 180 deletions(-) diff --git a/README.md b/README.md index 9210a24a..54213c6a 100755 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Full API documentation is available on [Github Pages](https://constructor-io.git ## 1. Install -Please follow the directions at [Jitpack.io](https://jitpack.io/#Constructor-io/constructorio-client-android/v2.36.0) to add the client to your project. +Please follow the directions at [Jitpack.io](https://jitpack.io/#Constructor-io/constructorio-client-android/v2.38.0-cdx-358-3) to add the client to your project. ## 2. Retrieve an API key diff --git a/library/build.gradle b/library/build.gradle index 99283036..432579d8 100755 --- a/library/build.gradle +++ b/library/build.gradle @@ -25,7 +25,7 @@ android { multiDexEnabled true testInstrumentationRunner "${applicationId}.runner.RxAndroidJUnitRunner" versionCode 1 - versionName '2.36.0' + versionName '2.38.0-cdx-358-3' buildConfigField("String", "CLIENT_VERSION", "\"cioand-${versionName}\"") buildConfigField("String", "DEFAULT_ITEM_SECTION", "\"Products\"") buildConfigField("String", "SERVICE_URL", "\"ac.cnstrc.com\"") diff --git a/library/src/test/java/io/constructor/core/ConstructorIoAutocompleteTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoAutocompleteTest.kt index 70f6c547..8d5ad2d5 100644 --- a/library/src/test/java/io/constructor/core/ConstructorIoAutocompleteTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoAutocompleteTest.kt @@ -68,7 +68,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -87,7 +87,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -110,7 +110,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&filters%5BSearch%20Suggestions%5D%5BstoreLocation%5D=US&filters%5BProducts%5D%5Bbrand%5D=Top%20Brand&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&filters%5BSearch%20Suggestions%5D%5BstoreLocation%5D=US&filters%5BProducts%5D%5Bbrand%5D=Top%20Brand&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -126,7 +126,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?filters%5Bgroup_id%5D=101&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?filters%5Bgroup_id%5D=101&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -140,7 +140,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -156,7 +156,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -172,7 +172,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -189,7 +189,7 @@ class ConstructorIoAutocompleteTest { ).test() val request = mockServer.takeRequest() val path = - "/autocomplete/bbq?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/bbq?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -201,7 +201,7 @@ class ConstructorIoAutocompleteTest { val observer = constructorIo.getAutocompleteResults("2% cheese").test() val request = mockServer.takeRequest() val path = - "/autocomplete/2%25%20cheese?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/2%25%20cheese?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -224,7 +224,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&filters%5Bgroup_id%5D=101&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&filters%5Bgroup_id%5D=101&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -247,7 +247,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?num_results_Products=5&num_results_Search%20Suggestions=10&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + "/autocomplete/titanic?num_results_Products=5&num_results_Search%20Suggestions=10&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -281,7 +281,7 @@ class ConstructorIoAutocompleteTest { "i" to "guido-the-guid", "ui" to "player-one", "s" to "79", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) diff --git a/library/src/test/java/io/constructor/core/ConstructorIoRecommendationsTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoRecommendationsTest.kt index f554a6bc..57921732 100644 --- a/library/src/test/java/io/constructor/core/ConstructorIoRecommendationsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoRecommendationsTest.kt @@ -76,7 +76,7 @@ class ConstructorIoRecommendationsTest { assertEquals(recommendationResponse?.response?.resultCount, 225) val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -89,7 +89,7 @@ class ConstructorIoRecommendationsTest { it.networkError } val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -103,7 +103,7 @@ class ConstructorIoRecommendationsTest { it.isError } val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -120,7 +120,7 @@ class ConstructorIoRecommendationsTest { assertEquals(recommendationResponse?.response?.resultCount, 0) val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -142,7 +142,7 @@ class ConstructorIoRecommendationsTest { assertEquals(recommendationResponse?.response?.resultCount, 225) val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -166,7 +166,7 @@ class ConstructorIoRecommendationsTest { assertEquals(recommendationResponse?.response?.resultCount, 225) val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?item_id=item_id_1&item_id=item_id_2&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/recommendations/v1/pods/titanic?item_id=item_id_1&item_id=item_id_2&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -201,7 +201,7 @@ class ConstructorIoRecommendationsTest { "i" to "guido-the-guid", "ui" to "player-one", "s" to "79", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) @@ -240,7 +240,7 @@ class ConstructorIoRecommendationsTest { "i" to "guido-the-guid", "ui" to "player-one", "s" to "79", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) @@ -281,7 +281,7 @@ class ConstructorIoRecommendationsTest { "i" to "guido-the-guid", "ui" to "player-one", "s" to "79", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) diff --git a/library/src/test/java/io/constructor/core/ConstructorIoTrackingTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoTrackingTest.kt index f2d732ef..1417cb4b 100755 --- a/library/src/test/java/io/constructor/core/ConstructorIoTrackingTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoTrackingTest.kt @@ -215,7 +215,7 @@ class ConstructorIoTrackingTest { val observer = constructorIo.trackSessionStartInternal().test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -226,7 +226,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSessionStartInternal().test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -238,7 +238,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSessionStartInternal().test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -249,7 +249,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -260,7 +260,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -272,7 +272,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -283,7 +283,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -294,7 +294,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions", ResultGroup("recommended", "123123"), "2346784").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&result_id=2346784&group%5Bgroup_id%5D=123123&group%5Bdisplay_name%5D=recommended&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&result_id=2346784&group%5Bgroup_id%5D=123123&group%5Bdisplay_name%5D=recommended&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -305,7 +305,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -317,7 +317,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -328,7 +328,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -339,7 +339,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -351,7 +351,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -363,7 +363,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("titanic", requestBody["search_term"]) assertEquals("10", requestBody["result_count"]) assertEquals(null, requestBody["items"]) @@ -397,7 +397,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("titanic", requestBody["search_term"]) assertEquals("10", requestBody["result_count"]) assertEquals("[{item_id:123},{item_id:234}]", requestBody["items"]) @@ -413,7 +413,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("titanic", requestBody["search_term"]) assertEquals("10", requestBody["result_count"]) assertEquals(null, requestBody["items"]) @@ -429,7 +429,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultsLoadedInternal("titanic", 10).test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -451,7 +451,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997",null, "titanic").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -482,7 +482,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997","RED", "titanic").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997&variation_id=RED§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997&variation_id=RED§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -493,7 +493,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997", null,"titanic", "Products","3467632").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&result_id=3467632&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&result_id=3467632&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -504,7 +504,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997",null, "titanic").test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -516,7 +516,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997",null, "titanic").test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -527,7 +527,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997",null,89.00).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" val requestBody = getRequestBody(request) assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) @@ -544,7 +544,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997","RED",89.00).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" val requestBody = getRequestBody(request) assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) @@ -563,7 +563,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) assertEquals("Like", requestBody["type"]) @@ -582,7 +582,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) assertEquals("add_to_loves", requestBody["type"]) @@ -603,7 +603,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) assertEquals("add_to_loves", requestBody["type"]) @@ -622,7 +622,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997","RED",89.00, "test", null, null, null, null, mapOf("test" to "test1", "appVersion" to "150")).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" val requestBody = getRequestBody(request) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -643,7 +643,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) assertEquals("89.00", requestBody["revenue"]) @@ -671,7 +671,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("[{item_id:TIT-REP-1997},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -687,7 +687,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("[{item_id:TIT-REP-1997},{item_id:TIT-REP-1997},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -703,7 +703,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("[{item_id:TIT-REP-1997,variation_id:RED},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -719,7 +719,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("[{item_id:TIT-REP-1997,variation_id:RED},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -736,7 +736,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("[{item_id:TIT-REP-1997},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -763,7 +763,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Recommendations&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/purchase?section=Recommendations&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("[{item_id:TIT-REP-1997},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -779,7 +779,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("10", requestBody["result_count"]) @@ -813,7 +813,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("10", requestBody["result_count"]) @@ -832,7 +832,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("10", requestBody["result_count"]) @@ -849,7 +849,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("10", requestBody["result_count"]) @@ -876,7 +876,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -917,7 +917,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -937,7 +937,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -955,7 +955,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -972,7 +972,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1000,7 +1000,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1018,7 +1018,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1037,7 +1037,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1066,7 +1066,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1083,7 +1083,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1101,7 +1101,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1129,7 +1129,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("User Featured", requestBody["strategy_id"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1145,7 +1145,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("User Featured", requestBody["strategy_id"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1162,7 +1162,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_click?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("User Featured", requestBody["strategy_id"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1178,7 +1178,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("User Featured", requestBody["strategy_id"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1205,7 +1205,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("4", requestBody["num_results_viewed"]) assertEquals("POST", request.method) @@ -1220,7 +1220,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("4", requestBody["num_results_viewed"]) assertEquals("{appVersion:150,appPlatform:Android,test:test1}", requestBody["analytics_tags"]) @@ -1237,7 +1237,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("[{item_id:123},{item_id:234}]", requestBody["items"]) assertEquals("4", requestBody["num_results_viewed"]) @@ -1254,7 +1254,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("4", requestBody["num_results_viewed"]) assertEquals("1", requestBody["result_page"]) @@ -1272,7 +1272,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("4", requestBody["num_results_viewed"]) assertEquals("POST", request.method) @@ -1298,7 +1298,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1321,7 +1321,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1345,7 +1345,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_click?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_result_click?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1368,7 +1368,7 @@ class ConstructorIoTrackingTest { observer.assertError{ true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1401,7 +1401,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_conversion?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_conversion?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1421,7 +1421,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_conversion?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_conversion?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1444,7 +1444,7 @@ class ConstructorIoTrackingTest { observer.assertError{ true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_conversion?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_conversion?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1477,7 +1477,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_result_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1496,7 +1496,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_load?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_result_load?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1516,7 +1516,7 @@ class ConstructorIoTrackingTest { observer.assertError{ true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_load?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/quiz_result_load?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetOptionsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetOptionsTest.kt index b50b3f10..f36a7a09 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetOptionsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetOptionsTest.kt @@ -77,7 +77,7 @@ class ConstructorioBrowseFacetOptionsTest { val request = mockServer.takeRequest() val path = - "/browse/facet_options?facet_name=brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/facet_options?facet_name=brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } @@ -131,7 +131,7 @@ class ConstructorioBrowseFacetOptionsTest { val request = mockServer.takeRequest() val path = - "/browse/facet_options?fmt_options%5Bshow_hidden_facets%5D=true&facet_name=Brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/facet_options?fmt_options%5Bshow_hidden_facets%5D=true&facet_name=Brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } @@ -146,7 +146,7 @@ class ConstructorioBrowseFacetOptionsTest { val observer = constructorIo.getBrowseFacetOptions(browseFacetOptionsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/facet_options?fmt_options%5Bshow_hidden_facets%5D=true&facet_name=Brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/facet_options?fmt_options%5Bshow_hidden_facets%5D=true&facet_name=Brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetsTest.kt index 7e1e1a1c..06b6218d 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetsTest.kt @@ -74,7 +74,7 @@ class ConstructorioBrowseFacetsTest { val request = mockServer.takeRequest() val path = - "/browse/facets?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/facets?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } @@ -129,7 +129,7 @@ class ConstructorioBrowseFacetsTest { val request = mockServer.takeRequest() val path = - "/browse/facets?page=5&offset=10&num_results_per_page=20&fmt_options%5Bshow_hidden_facets%5D=true&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/facets?page=5&offset=10&num_results_per_page=20&fmt_options%5Bshow_hidden_facets%5D=true&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } @@ -147,7 +147,7 @@ class ConstructorioBrowseFacetsTest { val observer = constructorIo.getBrowseFacets(browseFacetsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/facets?page=5&offset=10&num_results_per_page=20&fmt_options%5Bshow_hidden_facets%5D=true&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/facets?page=5&offset=10&num_results_per_page=20&fmt_options%5Bshow_hidden_facets%5D=true&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseGroupsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseGroupsTest.kt index 02101d86..45d33748 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseGroupsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseGroupsTest.kt @@ -71,7 +71,7 @@ class ConstructorioBrowseGroupsTest { val request = mockServer.takeRequest() val path = - "/browse/groups?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/groups?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } @@ -125,7 +125,7 @@ class ConstructorioBrowseGroupsTest { val request = mockServer.takeRequest() val path = - "/browse/groups?filters%5Bgroup_id%5D=Brand&fmt_options%5Bgroups_max_depth%5D=1&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/groups?filters%5Bgroup_id%5D=Brand&fmt_options%5Bgroups_max_depth%5D=1&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } @@ -141,7 +141,7 @@ class ConstructorioBrowseGroupsTest { val observer = constructorIo.getBrowseGroups(browseGroupsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/groups?filters%5Bgroup_id%5D=Brand&fmt_options%5Bgroups_max_depth%5D=1&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/browse/groups?filters%5Bgroup_id%5D=Brand&fmt_options%5Bgroups_max_depth%5D=1&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseItemsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseItemsTest.kt index a55751e1..7f9b515a 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseItemsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseItemsTest.kt @@ -84,7 +84,7 @@ class ConstructorIoBrowseItemsTest { val request = mockServer.takeRequest() val path = - "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -100,7 +100,7 @@ class ConstructorIoBrowseItemsTest { } val request = mockServer.takeRequest() val path = - "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" + "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" assert(request.path!!.startsWith(path)) } @@ -118,7 +118,7 @@ class ConstructorIoBrowseItemsTest { } val request = mockServer.takeRequest() val path = - "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" + "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" assert(request.path!!.startsWith(path)) } @@ -141,7 +141,7 @@ class ConstructorIoBrowseItemsTest { val request = mockServer.takeRequest() val path = - "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" + "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" assert(request.path!!.startsWith(path)) } @@ -156,7 +156,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?section=Sold%20Out&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/items?section=Sold%20Out&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -175,7 +175,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/items?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -190,7 +190,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/items?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -206,7 +206,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/items?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -222,7 +222,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/items?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -237,7 +237,7 @@ class ConstructorIoBrowseItemsTest { .build() val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() - val path = "/browse/items?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + val path = "/browse/items?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -267,7 +267,7 @@ class ConstructorIoBrowseItemsTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1", "ids" to "10001", ) diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseTest.kt index 705abb7d..c6af40b1 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseTest.kt @@ -81,7 +81,7 @@ class ConstructorIoBrowseTest { val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" + "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" assert(request.path!!.startsWith(path)) } @@ -95,7 +95,7 @@ class ConstructorIoBrowseTest { } val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" + "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" assert(request.path!!.startsWith(path)) } @@ -111,7 +111,7 @@ class ConstructorIoBrowseTest { } val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" + "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" assert(request.path!!.startsWith(path)) } @@ -132,7 +132,7 @@ class ConstructorIoBrowseTest { val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" + "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" assert(request.path!!.startsWith(path)) } @@ -154,7 +154,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?section=Sold%20Out&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" + "/browse/group_id/Beverages?section=Sold%20Out&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" assert(request.path!!.startsWith(path)) } @@ -180,7 +180,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/group_id/Beverages?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -203,7 +203,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -228,7 +228,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -240,7 +240,7 @@ class ConstructorIoBrowseTest { val observer = constructorIo.getBrowseResults("collection_id", "test-collection").test() val request = mockServer.takeRequest() val path = - "/browse/collection_id/test-collection?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/collection_id/test-collection?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -257,7 +257,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -274,7 +274,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -290,7 +290,7 @@ class ConstructorIoBrowseTest { preFilterExpression = preFilterExpression ).test() val request = mockServer.takeRequest() - val path = "/browse/group_id/Beverages?pre_filter_expression=%7B%22and%22%3A%5B%7B%22name%22%3A%22Country%22%2C%22value%22%3A%22US%22%7D%5D%7D&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + val path = "/browse/group_id/Beverages?pre_filter_expression=%7B%22and%22%3A%5B%7B%22name%22%3A%22Country%22%2C%22value%22%3A%22US%22%7D%5D%7D&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -309,7 +309,7 @@ class ConstructorIoBrowseTest { val observer = constructorIo.getBrowseResults(browseRequest).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/group_id/Beverages?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -325,7 +325,7 @@ class ConstructorIoBrowseTest { val observer = constructorIo.getBrowseResults(browseRequest).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -359,7 +359,7 @@ class ConstructorIoBrowseTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) @@ -393,7 +393,7 @@ class ConstructorIoBrowseTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) diff --git a/library/src/test/java/io/constructor/core/ConstructorioQuizTest.kt b/library/src/test/java/io/constructor/core/ConstructorioQuizTest.kt index 71fe992e..c7da72d5 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioQuizTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioQuizTest.kt @@ -71,7 +71,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/next?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -86,7 +86,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/next?quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -101,7 +101,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?quiz_session_id=31f6bdae-6f1d-482f-b37f-f7a9e346973a&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/next?quiz_session_id=31f6bdae-6f1d-482f-b37f-f7a9e346973a&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -116,7 +116,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?section=Products&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/next?section=Products&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -135,7 +135,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/next?a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -154,7 +154,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -173,7 +173,7 @@ class ConstructorioQuizTest { quizVersionId == "11db5ac7-67e1-4000-9000-414d8425cab3" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -192,7 +192,7 @@ class ConstructorioQuizTest { quizVersionId == "11db5ac7-67e1-4000-9000-414d8425cab3" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&quiz_session_id=31f6bdae-6f1d-482f-b37f-f7a9e346973a&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&quiz_session_id=31f6bdae-6f1d-482f-b37f-f7a9e346973a&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -211,7 +211,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?section=Products&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/results?section=Products&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -230,7 +230,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?page=2&num_results_per_page=30&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/results?page=2&num_results_per_page=30&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -249,7 +249,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?filters%5BBrand%5D=XYZ&filters%5BBrand%5D=123&filters%5Bgroup_id%5D=123&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/results?filters%5BBrand%5D=XYZ&filters%5BBrand%5D=123&filters%5Bgroup_id%5D=123&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -273,7 +273,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3§ion=Products&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/next?a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3§ion=Products&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -297,7 +297,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?section=Products&a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" + val path = "/v1/quizzes/test-quiz/results?section=Products&a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } } \ No newline at end of file diff --git a/library/src/test/java/io/constructor/core/ConstructorioSearchTest.kt b/library/src/test/java/io/constructor/core/ConstructorioSearchTest.kt index 965142e6..65059f77 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioSearchTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioSearchTest.kt @@ -82,7 +82,7 @@ class ConstructorIoSearchTest { val request = mockServer.takeRequest() val path = - "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -96,7 +96,7 @@ class ConstructorIoSearchTest { } val request = mockServer.takeRequest() val path = - "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -112,7 +112,7 @@ class ConstructorIoSearchTest { } val request = mockServer.takeRequest() val path = - "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -133,7 +133,7 @@ class ConstructorIoSearchTest { val request = mockServer.takeRequest() val path = - "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -152,7 +152,7 @@ class ConstructorIoSearchTest { val request = mockServer.takeRequest() val path = - "/search/bbq?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/bbq?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -166,7 +166,7 @@ class ConstructorIoSearchTest { .test() val request = mockServer.takeRequest() val path = - "/search/bbq?section=Sold%20Out&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/bbq?section=Sold%20Out&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -183,7 +183,7 @@ class ConstructorIoSearchTest { constructorIo.getSearchResults("bbq", facets, null, null, null, null, null, null).test() val request = mockServer.takeRequest() val path = - "/search/bbq?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/search/bbq?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } @@ -205,7 +205,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/bbq?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -229,7 +229,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/bbq?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -241,7 +241,7 @@ class ConstructorIoSearchTest { val observer = constructorIo.getSearchResults("2% cheese").test() val request = mockServer.takeRequest() val path = - "/search/2%25%20cheese?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/2%25%20cheese?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -257,7 +257,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=descending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=descending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -275,7 +275,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=descending&pre_filter_expression=%7B%22and%22%3A%5B%7B%22name%22%3A%22Country%22%2C%22value%22%3A%22US%22%7D%5D%7D&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=descending&pre_filter_expression=%7B%22and%22%3A%5B%7B%22name%22%3A%22Country%22%2C%22value%22%3A%22US%22%7D%5D%7D&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -291,7 +291,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/bbq?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -310,7 +310,7 @@ class ConstructorIoSearchTest { val observer = constructorIo.getSearchResults(searchRequest).test() val request = mockServer.takeRequest() val path = - "/search/bbq?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" + "/search/bbq?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" assert(request.path!!.startsWith(path)) } @@ -326,7 +326,7 @@ class ConstructorIoSearchTest { val observer = constructorIo.getSearchResults(searchRequest).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" + "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -360,7 +360,7 @@ class ConstructorIoSearchTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) @@ -394,7 +394,7 @@ class ConstructorIoSearchTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.36.0", + "c" to "cioand-2.38.0-cdx-358-3", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) diff --git a/library/src/test/java/io/constructor/core/ConstructorioSegmentsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioSegmentsTest.kt index df814e04..1ff6786f 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioSegmentsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioSegmentsTest.kt @@ -65,7 +65,7 @@ class ConstructorioSegmentsTest { suggestions?.isNotEmpty()!! && suggestions.size == 5 } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -76,7 +76,7 @@ class ConstructorioSegmentsTest { val observer = constructorIo.trackSessionStartInternal().test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/behavior?action=session_start&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -87,7 +87,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/behavior?term=tita&action=focus&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -98,7 +98,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -109,7 +109,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -120,7 +120,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackSearchResultsLoadedInternal("titanic", 10).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/search_result_load?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -131,7 +131,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997", null,"titanic").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -142,7 +142,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997", null, 89.00).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/conversion?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -153,7 +153,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackPurchaseInternal(arrayOf(PurchaseItem("TIT-REP-1997"), PurchaseItem("QE2-REP-1969")), 12.99, "ORD-1312343").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/purchase?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assertTrue(request.bodySize > 250) assert(request.path!!.startsWith(path)) } @@ -165,7 +165,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackRecommendationResultClickInternal("pdp5", "User Featured", "prrst_shldr_bls").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -176,7 +176,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackRecommendationResultsViewInternal("pdp5", null,4).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorioTestCellTest.kt b/library/src/test/java/io/constructor/core/ConstructorioTestCellTest.kt index d66bd99a..850ed5dc 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioTestCellTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioTestCellTest.kt @@ -66,7 +66,7 @@ class ConstructorioTestCellTest { suggestions?.isNotEmpty()!! && suggestions.size == 5 } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -77,7 +77,7 @@ class ConstructorioTestCellTest { val observer = constructorIo.trackSessionStartInternal().test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; + val path = "/behavior?action=session_start&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; assert(request.path!!.startsWith(path)) } @@ -88,7 +88,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; + val path = "/behavior?term=tita&action=focus&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; assert(request.path!!.startsWith(path)) } @@ -99,7 +99,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -110,7 +110,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; assert(request.path!!.startsWith(path)) } @@ -121,7 +121,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackSearchResultsLoadedInternal("titanic", 10).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/search_result_load?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; + val path = "/v2/behavioral_action/search_result_load?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; assert(request.path!!.startsWith(path)) } @@ -132,7 +132,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997", null, "titanic").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; assert(request.path!!.startsWith(path)) } @@ -143,7 +143,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997", null, 89.00).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; + val path = "/v2/behavioral_action/conversion?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; assert(request.path!!.startsWith(path)) } @@ -154,7 +154,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackPurchaseInternal(arrayOf(PurchaseItem("TIT-REP-1997"), PurchaseItem("QE2-REP-1969")), 12.99, "ORD-1312343").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/purchase?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; + val path = "/v2/behavioral_action/purchase?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; assertTrue(request.bodySize > 230) assert(request.path!!.startsWith(path)) } @@ -166,7 +166,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackRecommendationResultClickInternal("pdp5", "User Featured", "prrst_shldr_bls").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } @@ -177,7 +177,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackRecommendationResultsViewInternal("pdp5", null, 4).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt=" assert(request.path!!.startsWith(path)) } } From f8a524eb831efafa7af0cdce44c9fe7124e1d4c9 Mon Sep 17 00:00:00 2001 From: Hossam Hindawy Date: Mon, 2 Mar 2026 23:02:27 +0200 Subject: [PATCH 3/7] Revert "Version Bump" This reverts commit c9379206d4034b1d3ba014ce48d327428ea2d9a9. --- README.md | 2 +- library/build.gradle | 2 +- .../core/ConstructorIoAutocompleteTest.kt | 24 +-- .../core/ConstructorIoRecommendationsTest.kt | 18 +-- .../core/ConstructorIoTrackingTest.kt | 138 +++++++++--------- .../ConstructorioBrowseFacetOptionsTest.kt | 6 +- .../core/ConstructorioBrowseFacetsTest.kt | 6 +- .../core/ConstructorioBrowseGroupsTest.kt | 6 +- .../core/ConstructorioBrowseItemsTest.kt | 22 +-- .../core/ConstructorioBrowseTest.kt | 32 ++-- .../constructor/core/ConstructorioQuizTest.kt | 26 ++-- .../core/ConstructorioSearchTest.kt | 34 ++--- .../core/ConstructorioSegmentsTest.kt | 22 +-- .../core/ConstructorioTestCellTest.kt | 22 +-- 14 files changed, 180 insertions(+), 180 deletions(-) diff --git a/README.md b/README.md index 54213c6a..9210a24a 100755 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Full API documentation is available on [Github Pages](https://constructor-io.git ## 1. Install -Please follow the directions at [Jitpack.io](https://jitpack.io/#Constructor-io/constructorio-client-android/v2.38.0-cdx-358-3) to add the client to your project. +Please follow the directions at [Jitpack.io](https://jitpack.io/#Constructor-io/constructorio-client-android/v2.36.0) to add the client to your project. ## 2. Retrieve an API key diff --git a/library/build.gradle b/library/build.gradle index 432579d8..99283036 100755 --- a/library/build.gradle +++ b/library/build.gradle @@ -25,7 +25,7 @@ android { multiDexEnabled true testInstrumentationRunner "${applicationId}.runner.RxAndroidJUnitRunner" versionCode 1 - versionName '2.38.0-cdx-358-3' + versionName '2.36.0' buildConfigField("String", "CLIENT_VERSION", "\"cioand-${versionName}\"") buildConfigField("String", "DEFAULT_ITEM_SECTION", "\"Products\"") buildConfigField("String", "SERVICE_URL", "\"ac.cnstrc.com\"") diff --git a/library/src/test/java/io/constructor/core/ConstructorIoAutocompleteTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoAutocompleteTest.kt index 8d5ad2d5..70f6c547 100644 --- a/library/src/test/java/io/constructor/core/ConstructorIoAutocompleteTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoAutocompleteTest.kt @@ -68,7 +68,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -87,7 +87,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -110,7 +110,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&filters%5BSearch%20Suggestions%5D%5BstoreLocation%5D=US&filters%5BProducts%5D%5Bbrand%5D=Top%20Brand&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&filters%5BSearch%20Suggestions%5D%5BstoreLocation%5D=US&filters%5BProducts%5D%5Bbrand%5D=Top%20Brand&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -126,7 +126,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?filters%5Bgroup_id%5D=101&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?filters%5Bgroup_id%5D=101&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -140,7 +140,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -156,7 +156,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -172,7 +172,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -189,7 +189,7 @@ class ConstructorIoAutocompleteTest { ).test() val request = mockServer.takeRequest() val path = - "/autocomplete/bbq?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/bbq?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -201,7 +201,7 @@ class ConstructorIoAutocompleteTest { val observer = constructorIo.getAutocompleteResults("2% cheese").test() val request = mockServer.takeRequest() val path = - "/autocomplete/2%25%20cheese?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/2%25%20cheese?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -224,7 +224,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&filters%5Bgroup_id%5D=101&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?filters%5BstoreLocation%5D=CA&filters%5Bgroup_id%5D=101&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -247,7 +247,7 @@ class ConstructorIoAutocompleteTest { } val request = mockServer.takeRequest() val path = - "/autocomplete/titanic?num_results_Products=5&num_results_Search%20Suggestions=10&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + "/autocomplete/titanic?num_results_Products=5&num_results_Search%20Suggestions=10&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -281,7 +281,7 @@ class ConstructorIoAutocompleteTest { "i" to "guido-the-guid", "ui" to "player-one", "s" to "79", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) diff --git a/library/src/test/java/io/constructor/core/ConstructorIoRecommendationsTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoRecommendationsTest.kt index 57921732..f554a6bc 100644 --- a/library/src/test/java/io/constructor/core/ConstructorIoRecommendationsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoRecommendationsTest.kt @@ -76,7 +76,7 @@ class ConstructorIoRecommendationsTest { assertEquals(recommendationResponse?.response?.resultCount, 225) val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -89,7 +89,7 @@ class ConstructorIoRecommendationsTest { it.networkError } val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -103,7 +103,7 @@ class ConstructorIoRecommendationsTest { it.isError } val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -120,7 +120,7 @@ class ConstructorIoRecommendationsTest { assertEquals(recommendationResponse?.response?.resultCount, 0) val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -142,7 +142,7 @@ class ConstructorIoRecommendationsTest { assertEquals(recommendationResponse?.response?.resultCount, 225) val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/recommendations/v1/pods/titanic?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -166,7 +166,7 @@ class ConstructorIoRecommendationsTest { assertEquals(recommendationResponse?.response?.resultCount, 225) val request = mockServer.takeRequest() - val path = "/recommendations/v1/pods/titanic?item_id=item_id_1&item_id=item_id_2&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/recommendations/v1/pods/titanic?item_id=item_id_1&item_id=item_id_2&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -201,7 +201,7 @@ class ConstructorIoRecommendationsTest { "i" to "guido-the-guid", "ui" to "player-one", "s" to "79", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) @@ -240,7 +240,7 @@ class ConstructorIoRecommendationsTest { "i" to "guido-the-guid", "ui" to "player-one", "s" to "79", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) @@ -281,7 +281,7 @@ class ConstructorIoRecommendationsTest { "i" to "guido-the-guid", "ui" to "player-one", "s" to "79", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) diff --git a/library/src/test/java/io/constructor/core/ConstructorIoTrackingTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoTrackingTest.kt index 1417cb4b..f2d732ef 100755 --- a/library/src/test/java/io/constructor/core/ConstructorIoTrackingTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoTrackingTest.kt @@ -215,7 +215,7 @@ class ConstructorIoTrackingTest { val observer = constructorIo.trackSessionStartInternal().test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -226,7 +226,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSessionStartInternal().test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -238,7 +238,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSessionStartInternal().test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/behavior?action=session_start&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -249,7 +249,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -260,7 +260,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -272,7 +272,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/behavior?term=tita&action=focus&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -283,7 +283,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -294,7 +294,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions", ResultGroup("recommended", "123123"), "2346784").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&result_id=2346784&group%5Bgroup_id%5D=123123&group%5Bdisplay_name%5D=recommended&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&result_id=2346784&group%5Bgroup_id%5D=123123&group%5Bdisplay_name%5D=recommended&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -305,7 +305,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -317,7 +317,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -328,7 +328,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -339,7 +339,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -351,7 +351,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -363,7 +363,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("titanic", requestBody["search_term"]) assertEquals("10", requestBody["result_count"]) assertEquals(null, requestBody["items"]) @@ -397,7 +397,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("titanic", requestBody["search_term"]) assertEquals("10", requestBody["result_count"]) assertEquals("[{item_id:123},{item_id:234}]", requestBody["items"]) @@ -413,7 +413,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("titanic", requestBody["search_term"]) assertEquals("10", requestBody["result_count"]) assertEquals(null, requestBody["items"]) @@ -429,7 +429,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultsLoadedInternal("titanic", 10).test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -451,7 +451,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997",null, "titanic").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -482,7 +482,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997","RED", "titanic").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997&variation_id=RED§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997&variation_id=RED§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -493,7 +493,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997", null,"titanic", "Products","3467632").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&result_id=3467632&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&result_id=3467632&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -504,7 +504,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997",null, "titanic").test() observer.assertError { true } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -516,7 +516,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997",null, "titanic").test() observer.assertError(SocketTimeoutException::class.java) val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -527,7 +527,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997",null,89.00).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" val requestBody = getRequestBody(request) assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) @@ -544,7 +544,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997","RED",89.00).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" val requestBody = getRequestBody(request) assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) @@ -563,7 +563,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) assertEquals("Like", requestBody["type"]) @@ -582,7 +582,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) assertEquals("add_to_loves", requestBody["type"]) @@ -603,7 +603,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) assertEquals("add_to_loves", requestBody["type"]) @@ -622,7 +622,7 @@ class ConstructorIoTrackingTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997","RED",89.00, "test", null, null, null, null, mapOf("test" to "test1", "appVersion" to "150")).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" val requestBody = getRequestBody(request) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -643,7 +643,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/conversion?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("TIT-REP-1997", requestBody["item_id"]) assertEquals("titanic replica", requestBody["item_name"]) assertEquals("89.00", requestBody["revenue"]) @@ -671,7 +671,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("[{item_id:TIT-REP-1997},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -687,7 +687,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("[{item_id:TIT-REP-1997},{item_id:TIT-REP-1997},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -703,7 +703,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("[{item_id:TIT-REP-1997,variation_id:RED},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -719,7 +719,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("[{item_id:TIT-REP-1997,variation_id:RED},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -736,7 +736,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("[{item_id:TIT-REP-1997},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -763,7 +763,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/purchase?section=Recommendations&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/purchase?section=Recommendations&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("[{item_id:TIT-REP-1997},{item_id:QE2-REP-1969}]", requestBody["items"]) assertEquals("ORD-1312343", requestBody["order_id"]) assertEquals("12.99", requestBody["revenue"]) @@ -779,7 +779,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("10", requestBody["result_count"]) @@ -813,7 +813,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("10", requestBody["result_count"]) @@ -832,7 +832,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("10", requestBody["result_count"]) @@ -849,7 +849,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_load?key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("10", requestBody["result_count"]) @@ -876,7 +876,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -917,7 +917,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -937,7 +937,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -955,7 +955,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -972,7 +972,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/browse_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("group_id", requestBody["filter_name"]) assertEquals("Movies", requestBody["filter_value"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1000,7 +1000,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1018,7 +1018,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1037,7 +1037,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/item_detail_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1066,7 +1066,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1083,7 +1083,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1101,7 +1101,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pencil", requestBody["item_name"]) assertEquals("123", requestBody["item_id"]) assertEquals("456", requestBody["variation_id"]) @@ -1129,7 +1129,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("User Featured", requestBody["strategy_id"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1145,7 +1145,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("User Featured", requestBody["strategy_id"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1162,7 +1162,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_click?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("User Featured", requestBody["strategy_id"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1178,7 +1178,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("User Featured", requestBody["strategy_id"]) assertEquals("TIT-REP-1997", requestBody["item_id"]) @@ -1205,7 +1205,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("4", requestBody["num_results_viewed"]) assertEquals("POST", request.method) @@ -1220,7 +1220,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("4", requestBody["num_results_viewed"]) assertEquals("{appVersion:150,appPlatform:Android,test:test1}", requestBody["analytics_tags"]) @@ -1237,7 +1237,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("[{item_id:123},{item_id:234}]", requestBody["items"]) assertEquals("4", requestBody["num_results_viewed"]) @@ -1254,7 +1254,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("4", requestBody["num_results_viewed"]) assertEquals("1", requestBody["result_page"]) @@ -1272,7 +1272,7 @@ class ConstructorIoTrackingTest { observer.assertError { true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("pdp5", requestBody["pod_id"]) assertEquals("4", requestBody["num_results_viewed"]) assertEquals("POST", request.method) @@ -1298,7 +1298,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1321,7 +1321,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1345,7 +1345,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_click?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_result_click?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1368,7 +1368,7 @@ class ConstructorIoTrackingTest { observer.assertError{ true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_result_click?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1401,7 +1401,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_conversion?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_conversion?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1421,7 +1421,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_conversion?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_conversion?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1444,7 +1444,7 @@ class ConstructorIoTrackingTest { observer.assertError{ true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_conversion?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_conversion?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1477,7 +1477,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_result_load?section=Products&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1496,7 +1496,7 @@ class ConstructorIoTrackingTest { observer.assertComplete() val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_load?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_result_load?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) @@ -1516,7 +1516,7 @@ class ConstructorIoTrackingTest { observer.assertError{ true } val request = mockServer.takeRequest() val requestBody = getRequestBody(request) - val path = "/v2/behavioral_action/quiz_result_load?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/quiz_result_load?section=Search%20Suggestions&key=copper-key&i=wacko-the-guid&ui=player-three&s=67&c=cioand-2.36.0&_dt=" assertEquals("coffee-quiz", requestBody["quiz_id"]) assertEquals("23AECMA-1EFKCI", requestBody["quiz_version_id"]) assertEquals("34NCUIEI-214CDN", requestBody["quiz_session_id"]) diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetOptionsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetOptionsTest.kt index f36a7a09..b50b3f10 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetOptionsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetOptionsTest.kt @@ -77,7 +77,7 @@ class ConstructorioBrowseFacetOptionsTest { val request = mockServer.takeRequest() val path = - "/browse/facet_options?facet_name=brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/facet_options?facet_name=brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } @@ -131,7 +131,7 @@ class ConstructorioBrowseFacetOptionsTest { val request = mockServer.takeRequest() val path = - "/browse/facet_options?fmt_options%5Bshow_hidden_facets%5D=true&facet_name=Brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/facet_options?fmt_options%5Bshow_hidden_facets%5D=true&facet_name=Brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } @@ -146,7 +146,7 @@ class ConstructorioBrowseFacetOptionsTest { val observer = constructorIo.getBrowseFacetOptions(browseFacetOptionsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/facet_options?fmt_options%5Bshow_hidden_facets%5D=true&facet_name=Brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/facet_options?fmt_options%5Bshow_hidden_facets%5D=true&facet_name=Brands&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetsTest.kt index 06b6218d..7e1e1a1c 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseFacetsTest.kt @@ -74,7 +74,7 @@ class ConstructorioBrowseFacetsTest { val request = mockServer.takeRequest() val path = - "/browse/facets?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/facets?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } @@ -129,7 +129,7 @@ class ConstructorioBrowseFacetsTest { val request = mockServer.takeRequest() val path = - "/browse/facets?page=5&offset=10&num_results_per_page=20&fmt_options%5Bshow_hidden_facets%5D=true&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/facets?page=5&offset=10&num_results_per_page=20&fmt_options%5Bshow_hidden_facets%5D=true&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } @@ -147,7 +147,7 @@ class ConstructorioBrowseFacetsTest { val observer = constructorIo.getBrowseFacets(browseFacetsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/facets?page=5&offset=10&num_results_per_page=20&fmt_options%5Bshow_hidden_facets%5D=true&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/facets?page=5&offset=10&num_results_per_page=20&fmt_options%5Bshow_hidden_facets%5D=true&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseGroupsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseGroupsTest.kt index 45d33748..02101d86 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseGroupsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseGroupsTest.kt @@ -71,7 +71,7 @@ class ConstructorioBrowseGroupsTest { val request = mockServer.takeRequest() val path = - "/browse/groups?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/groups?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } @@ -125,7 +125,7 @@ class ConstructorioBrowseGroupsTest { val request = mockServer.takeRequest() val path = - "/browse/groups?filters%5Bgroup_id%5D=Brand&fmt_options%5Bgroups_max_depth%5D=1&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/groups?filters%5Bgroup_id%5D=Brand&fmt_options%5Bgroups_max_depth%5D=1&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } @@ -141,7 +141,7 @@ class ConstructorioBrowseGroupsTest { val observer = constructorIo.getBrowseGroups(browseGroupsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/groups?filters%5Bgroup_id%5D=Brand&fmt_options%5Bgroups_max_depth%5D=1&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/browse/groups?filters%5Bgroup_id%5D=Brand&fmt_options%5Bgroups_max_depth%5D=1&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseItemsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseItemsTest.kt index 7f9b515a..a55751e1 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseItemsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseItemsTest.kt @@ -84,7 +84,7 @@ class ConstructorIoBrowseItemsTest { val request = mockServer.takeRequest() val path = - "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -100,7 +100,7 @@ class ConstructorIoBrowseItemsTest { } val request = mockServer.takeRequest() val path = - "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" + "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" assert(request.path!!.startsWith(path)) } @@ -118,7 +118,7 @@ class ConstructorIoBrowseItemsTest { } val request = mockServer.takeRequest() val path = - "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" + "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" assert(request.path!!.startsWith(path)) } @@ -141,7 +141,7 @@ class ConstructorIoBrowseItemsTest { val request = mockServer.takeRequest() val path = - "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" + "/browse/items?ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" assert(request.path!!.startsWith(path)) } @@ -156,7 +156,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?section=Sold%20Out&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/items?section=Sold%20Out&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -175,7 +175,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/items?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -190,7 +190,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/items?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -206,7 +206,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/items?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -222,7 +222,7 @@ class ConstructorIoBrowseItemsTest { val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() val path = - "/browse/items?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/items?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -237,7 +237,7 @@ class ConstructorIoBrowseItemsTest { .build() val observer = constructorIo.getBrowseItemsResults(browseItemsRequest).test() val request = mockServer.takeRequest() - val path = "/browse/items?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/browse/items?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&ids=10001&ids=dai_pid_2003597&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -267,7 +267,7 @@ class ConstructorIoBrowseItemsTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1", "ids" to "10001", ) diff --git a/library/src/test/java/io/constructor/core/ConstructorioBrowseTest.kt b/library/src/test/java/io/constructor/core/ConstructorioBrowseTest.kt index c6af40b1..705abb7d 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioBrowseTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioBrowseTest.kt @@ -81,7 +81,7 @@ class ConstructorIoBrowseTest { val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" + "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" assert(request.path!!.startsWith(path)) } @@ -95,7 +95,7 @@ class ConstructorIoBrowseTest { } val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" + "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" assert(request.path!!.startsWith(path)) } @@ -111,7 +111,7 @@ class ConstructorIoBrowseTest { } val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" + "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" assert(request.path!!.startsWith(path)) } @@ -132,7 +132,7 @@ class ConstructorIoBrowseTest { val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" + "/browse/group_id/Beverages?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" assert(request.path!!.startsWith(path)) } @@ -154,7 +154,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?section=Sold%20Out&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt" + "/browse/group_id/Beverages?section=Sold%20Out&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt" assert(request.path!!.startsWith(path)) } @@ -180,7 +180,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/group_id/Beverages?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -203,7 +203,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -228,7 +228,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -240,7 +240,7 @@ class ConstructorIoBrowseTest { val observer = constructorIo.getBrowseResults("collection_id", "test-collection").test() val request = mockServer.takeRequest() val path = - "/browse/collection_id/test-collection?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/collection_id/test-collection?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -257,7 +257,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -274,7 +274,7 @@ class ConstructorIoBrowseTest { ).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -290,7 +290,7 @@ class ConstructorIoBrowseTest { preFilterExpression = preFilterExpression ).test() val request = mockServer.takeRequest() - val path = "/browse/group_id/Beverages?pre_filter_expression=%7B%22and%22%3A%5B%7B%22name%22%3A%22Country%22%2C%22value%22%3A%22US%22%7D%5D%7D&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/browse/group_id/Beverages?pre_filter_expression=%7B%22and%22%3A%5B%7B%22name%22%3A%22Country%22%2C%22value%22%3A%22US%22%7D%5D%7D&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -309,7 +309,7 @@ class ConstructorIoBrowseTest { val observer = constructorIo.getBrowseResults(browseRequest).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/group_id/Beverages?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -325,7 +325,7 @@ class ConstructorIoBrowseTest { val observer = constructorIo.getBrowseResults(browseRequest).test() val request = mockServer.takeRequest() val path = - "/browse/group_id/Beverages?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/browse/group_id/Beverages?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -359,7 +359,7 @@ class ConstructorIoBrowseTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) @@ -393,7 +393,7 @@ class ConstructorIoBrowseTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) diff --git a/library/src/test/java/io/constructor/core/ConstructorioQuizTest.kt b/library/src/test/java/io/constructor/core/ConstructorioQuizTest.kt index c7da72d5..71fe992e 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioQuizTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioQuizTest.kt @@ -71,7 +71,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/next?key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -86,7 +86,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/next?quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -101,7 +101,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?quiz_session_id=31f6bdae-6f1d-482f-b37f-f7a9e346973a&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/next?quiz_session_id=31f6bdae-6f1d-482f-b37f-f7a9e346973a&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -116,7 +116,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?section=Products&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/next?section=Products&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -135,7 +135,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/next?a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -154,7 +154,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -173,7 +173,7 @@ class ConstructorioQuizTest { quizVersionId == "11db5ac7-67e1-4000-9000-414d8425cab3" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -192,7 +192,7 @@ class ConstructorioQuizTest { quizVersionId == "11db5ac7-67e1-4000-9000-414d8425cab3" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&quiz_session_id=31f6bdae-6f1d-482f-b37f-f7a9e346973a&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/results?a=1&a=2%2C3&quiz_session_id=31f6bdae-6f1d-482f-b37f-f7a9e346973a&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -211,7 +211,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?section=Products&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/results?section=Products&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -230,7 +230,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?page=2&num_results_per_page=30&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/results?page=2&num_results_per_page=30&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -249,7 +249,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?filters%5BBrand%5D=XYZ&filters%5BBrand%5D=123&filters%5Bgroup_id%5D=123&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/results?filters%5BBrand%5D=XYZ&filters%5BBrand%5D=123&filters%5Bgroup_id%5D=123&a=1&a=2%2C3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -273,7 +273,7 @@ class ConstructorioQuizTest { quizQuestionId !== null } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/next?a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3§ion=Products&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/next?a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3§ion=Products&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -297,7 +297,7 @@ class ConstructorioQuizTest { quizId == "test-quiz" } val request = mockServer.takeRequest() - val path = "/v1/quizzes/test-quiz/results?section=Products&a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v1/quizzes/test-quiz/results?section=Products&a=1&a=2%2C3&quiz_version_id=11db5ac7-67e1-4000-9000-414d8425cab3&key=golden-key&i=guido-the-guid&ui=player-one&s=79&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } } \ No newline at end of file diff --git a/library/src/test/java/io/constructor/core/ConstructorioSearchTest.kt b/library/src/test/java/io/constructor/core/ConstructorioSearchTest.kt index 65059f77..965142e6 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioSearchTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioSearchTest.kt @@ -82,7 +82,7 @@ class ConstructorIoSearchTest { val request = mockServer.takeRequest() val path = - "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -96,7 +96,7 @@ class ConstructorIoSearchTest { } val request = mockServer.takeRequest() val path = - "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -112,7 +112,7 @@ class ConstructorIoSearchTest { } val request = mockServer.takeRequest() val path = - "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -133,7 +133,7 @@ class ConstructorIoSearchTest { val request = mockServer.takeRequest() val path = - "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/corn?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -152,7 +152,7 @@ class ConstructorIoSearchTest { val request = mockServer.takeRequest() val path = - "/search/bbq?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/bbq?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -166,7 +166,7 @@ class ConstructorIoSearchTest { .test() val request = mockServer.takeRequest() val path = - "/search/bbq?section=Sold%20Out&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/bbq?section=Sold%20Out&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -183,7 +183,7 @@ class ConstructorIoSearchTest { constructorIo.getSearchResults("bbq", facets, null, null, null, null, null, null).test() val request = mockServer.takeRequest() val path = - "/search/bbq?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/search/bbq?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } @@ -205,7 +205,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/bbq?fmt_options%5Bhidden_fields%5D=hiddenField1&fmt_options%5Bhidden_fields%5D=hiddenField2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -229,7 +229,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/bbq?fmt_options%5Bhidden_facets%5D=Brand&fmt_options%5Bhidden_facets%5D=price_US&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -241,7 +241,7 @@ class ConstructorIoSearchTest { val observer = constructorIo.getSearchResults("2% cheese").test() val request = mockServer.takeRequest() val path = - "/search/2%25%20cheese?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/2%25%20cheese?key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -257,7 +257,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=descending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=descending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -275,7 +275,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=descending&pre_filter_expression=%7B%22and%22%3A%5B%7B%22name%22%3A%22Country%22%2C%22value%22%3A%22US%22%7D%5D%7D&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=descending&pre_filter_expression=%7B%22and%22%3A%5B%7B%22name%22%3A%22Country%22%2C%22value%22%3A%22US%22%7D%5D%7D&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -291,7 +291,7 @@ class ConstructorIoSearchTest { ).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/bbq?fmt_options%5Bgroups_start%5D=5&fmt_options%5Bshow_hidden_facets%5D=false&fmt_options%5Bgroups_sort_order%5D=ascending&fmt_options%5Bfields%5D=false&fmt_options%5Bfields%5D=test2&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -310,7 +310,7 @@ class ConstructorIoSearchTest { val observer = constructorIo.getSearchResults(searchRequest).test() val request = mockServer.takeRequest() val path = - "/search/bbq?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3" + "/search/bbq?filters%5BBrand%5D=Signature%20Farms&filters%5BBrand%5D=Del%20Monte&filters%5BNutrition%5D=Organic&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0" assert(request.path!!.startsWith(path)) } @@ -326,7 +326,7 @@ class ConstructorIoSearchTest { val observer = constructorIo.getSearchResults(searchRequest).test() val request = mockServer.takeRequest() val path = - "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.38.0-cdx-358-3&_dt=" + "/search/bbq?fmt_options%5Bgroups_sort_by%5D=value&fmt_options%5Bgroups_sort_order%5D=ascending&key=silver-key&i=guapo-the-guid&ui=player-two&s=92&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -360,7 +360,7 @@ class ConstructorIoSearchTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) @@ -394,7 +394,7 @@ class ConstructorIoSearchTest { "i" to "guapo-the-guid", "ui" to "player-two", "s" to "92", - "c" to "cioand-2.38.0-cdx-358-3", + "c" to "cioand-2.36.0", "_dt" to "1" ) assertThat(queryParameterNames).containsExactlyInAnyOrderElementsOf(queryParams.keys) diff --git a/library/src/test/java/io/constructor/core/ConstructorioSegmentsTest.kt b/library/src/test/java/io/constructor/core/ConstructorioSegmentsTest.kt index 1ff6786f..df814e04 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioSegmentsTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioSegmentsTest.kt @@ -65,7 +65,7 @@ class ConstructorioSegmentsTest { suggestions?.isNotEmpty()!! && suggestions.size == 5 } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -76,7 +76,7 @@ class ConstructorioSegmentsTest { val observer = constructorIo.trackSessionStartInternal().test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/behavior?action=session_start&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -87,7 +87,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/behavior?term=tita&action=focus&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -98,7 +98,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -109,7 +109,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -120,7 +120,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackSearchResultsLoadedInternal("titanic", 10).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/search_result_load?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/search_result_load?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -131,7 +131,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997", null,"titanic").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -142,7 +142,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997", null, 89.00).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/conversion?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -153,7 +153,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackPurchaseInternal(arrayOf(PurchaseItem("TIT-REP-1997"), PurchaseItem("QE2-REP-1969")), 12.99, "ORD-1312343").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/purchase?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/purchase?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assertTrue(request.bodySize > 250) assert(request.path!!.startsWith(path)) } @@ -165,7 +165,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackRecommendationResultClickInternal("pdp5", "User Featured", "prrst_shldr_bls").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -176,7 +176,7 @@ class ConstructorioSegmentsTest { val observer = ConstructorIo.trackRecommendationResultsViewInternal("pdp5", null,4).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&us=mobile&us=COUNTRY_US&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorioTestCellTest.kt b/library/src/test/java/io/constructor/core/ConstructorioTestCellTest.kt index 850ed5dc..d66bd99a 100644 --- a/library/src/test/java/io/constructor/core/ConstructorioTestCellTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorioTestCellTest.kt @@ -66,7 +66,7 @@ class ConstructorioTestCellTest { suggestions?.isNotEmpty()!! && suggestions.size == 5 } val request = mockServer.takeRequest() - val path = "/autocomplete/titanic?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -77,7 +77,7 @@ class ConstructorioTestCellTest { val observer = constructorIo.trackSessionStartInternal().test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?action=session_start&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; + val path = "/behavior?action=session_start&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; assert(request.path!!.startsWith(path)) } @@ -88,7 +88,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackInputFocusInternal("tita").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/behavior?term=tita&action=focus&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; + val path = "/behavior?term=tita&action=focus&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; assert(request.path!!.startsWith(path)) } @@ -99,7 +99,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackAutocompleteSelectInternal("titanic", "tit", "Search Suggestions").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/autocomplete/titanic/select?section=Search%20Suggestions&original_query=tit&tr=click&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -110,7 +110,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackSearchSubmitInternal("titanic", "tit", null).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; + val path = "/autocomplete/titanic/search?original_query=tit&tr=search&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; assert(request.path!!.startsWith(path)) } @@ -121,7 +121,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackSearchResultsLoadedInternal("titanic", 10).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/search_result_load?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; + val path = "/v2/behavioral_action/search_result_load?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; assert(request.path!!.startsWith(path)) } @@ -132,7 +132,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackSearchResultClickInternal("titanic replica", "TIT-REP-1997", null, "titanic").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; + val path = "/autocomplete/titanic/click_through?name=titanic%20replica&customer_id=TIT-REP-1997§ion=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; assert(request.path!!.startsWith(path)) } @@ -143,7 +143,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackConversionInternal("titanic replica", "TIT-REP-1997", null, 89.00).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/conversion?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; + val path = "/v2/behavioral_action/conversion?key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; assert(request.path!!.startsWith(path)) } @@ -154,7 +154,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackPurchaseInternal(arrayOf(PurchaseItem("TIT-REP-1997"), PurchaseItem("QE2-REP-1969")), 12.99, "ORD-1312343").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/purchase?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt="; + val path = "/v2/behavioral_action/purchase?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt="; assertTrue(request.bodySize > 230) assert(request.path!!.startsWith(path)) } @@ -166,7 +166,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackRecommendationResultClickInternal("pdp5", "User Featured", "prrst_shldr_bls").test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_click?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } @@ -177,7 +177,7 @@ class ConstructorioTestCellTest { val observer = ConstructorIo.trackRecommendationResultsViewInternal("pdp5", null, 4).test() observer.assertComplete() val request = mockServer.takeRequest() - val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.38.0-cdx-358-3&_dt=" + val path = "/v2/behavioral_action/recommendation_result_view?section=Products&key=aluminium-key&i=koopa-the-guid&ui=player-two&s=14&ef-cellone=vanilla&ef-celltwo=whipped-cream&c=cioand-2.36.0&_dt=" assert(request.path!!.startsWith(path)) } } From 5bdae0888e1d19682ae52701ac47ef9035fbb001 Mon Sep 17 00:00:00 2001 From: Hossam Hindawy Date: Thu, 12 Mar 2026 17:40:50 +0200 Subject: [PATCH 4/7] add tests --- .../java/io/constructor/core/ConstructorIo.kt | 2 +- .../core/ConstructorIoRxErrorHandlerTest.kt | 93 +++++++++++++++++++ 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt diff --git a/library/src/main/java/io/constructor/core/ConstructorIo.kt b/library/src/main/java/io/constructor/core/ConstructorIo.kt index d0793d1a..6617f747 100755 --- a/library/src/main/java/io/constructor/core/ConstructorIo.kt +++ b/library/src/main/java/io/constructor/core/ConstructorIo.kt @@ -143,7 +143,7 @@ object ConstructorIo { * These exceptions can occur when network errors happen after the RxJava stream has * already completed or been disposed, particularly with OkHttp async operations. */ - private fun setupRxJavaErrorHandler() { + internal fun setupRxJavaErrorHandler() { RxJavaPlugins.setErrorHandler { throwable -> var error = throwable // Unwrap the actual cause from UndeliverableException diff --git a/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt new file mode 100644 index 00000000..7361c97b --- /dev/null +++ b/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt @@ -0,0 +1,93 @@ +package io.constructor.core + +import android.content.Context +import io.constructor.data.local.PreferencesHelper +import io.constructor.data.memory.ConfigMemoryHolder +import io.constructor.test.createTestDataManager +import io.constructor.util.RxSchedulersOverrideRule +import io.mockk.every +import io.mockk.mockk +import io.reactivex.exceptions.UndeliverableException +import io.reactivex.plugins.RxJavaPlugins +import okhttp3.mockwebserver.MockWebServer +import org.junit.After +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import java.io.IOException + +class ConstructorIoRxErrorHandlerTest { + + @Rule + @JvmField + val overrideSchedulersRule = RxSchedulersOverrideRule() + + private lateinit var mockServer: MockWebServer + private var constructorIo = ConstructorIo + private val ctx = mockk() + private val preferencesHelper = mockk() + private val configMemoryHolder = mockk() + + @Before + fun setup() { + mockServer = MockWebServer() + mockServer.start() + + every { ctx.applicationContext } returns ctx + + every { preferencesHelper.apiKey } returns "golden-key" + every { preferencesHelper.id } returns "guido-the-guid" + every { preferencesHelper.serviceUrl } returns mockServer.hostName + every { preferencesHelper.port } returns mockServer.port + every { preferencesHelper.scheme } returns "http" + every { preferencesHelper.defaultItemSection } returns "Products" + every { preferencesHelper.getSessionId(any(), any()) } returns 79 + + every { configMemoryHolder.autocompleteResultCount } returns null + every { configMemoryHolder.userId } returns "player-one" + every { configMemoryHolder.testCellParams } returns emptyList() + every { configMemoryHolder.segments } returns emptyList() + + val config = ConstructorIoConfig("dummyKey") + val dataManager = createTestDataManager(preferencesHelper, configMemoryHolder) + + constructorIo.testInit(ctx, config, dataManager, preferencesHelper, configMemoryHolder) + constructorIo.setupRxJavaErrorHandler() + } + + @After + fun teardown() { + mockServer.shutdown() + RxJavaPlugins.reset() + } + + @Test + fun handlesUndeliverableIOException() { + // Should not throw - IOException is handled gracefully + RxJavaPlugins.onError(UndeliverableException(IOException("network timeout"))) + } + + @Test + fun handlesUndeliverableInterruptedException() { + // Should not throw - InterruptedException is handled gracefully + RxJavaPlugins.onError(UndeliverableException(InterruptedException("thread interrupted"))) + } + + @Test + fun handlesRawIOException() { + // Should not throw - IOException without UndeliverableException wrapper + RxJavaPlugins.onError(IOException("connection reset")) + } + + @Test + fun handlesUnexpectedException() { + // Should not throw - unexpected exceptions are logged but don't crash + RxJavaPlugins.onError(UndeliverableException(IllegalStateException("unexpected error"))) + } + + @Test + fun handlesUndeliverableExceptionWithNullCause() { + // Should not throw - UndeliverableException with no cause + RxJavaPlugins.onError(UndeliverableException(null)) + } +} From 09aaf14f0b47922a16620bf970fb27f11569bd66 Mon Sep 17 00:00:00 2001 From: Hossam Hindawy Date: Thu, 12 Mar 2026 19:50:27 +0200 Subject: [PATCH 5/7] re-throw unexpected exceptions on the current thread --- .../java/io/constructor/core/ConstructorIo.kt | 6 +-- .../core/ConstructorIoRxErrorHandlerTest.kt | 43 ++++++++++++++++--- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/library/src/main/java/io/constructor/core/ConstructorIo.kt b/library/src/main/java/io/constructor/core/ConstructorIo.kt index 6617f747..dab049a6 100755 --- a/library/src/main/java/io/constructor/core/ConstructorIo.kt +++ b/library/src/main/java/io/constructor/core/ConstructorIo.kt @@ -158,9 +158,9 @@ object ConstructorIo { return@setErrorHandler } - // For other unexpected exceptions, log them as errors - // but still don't crash - these shouldn't bring down the host app - e("Constructor.io: Undeliverable exception: ${error.javaClass.simpleName} - ${error.message}") + // Unexpected exception — re-throw on the current thread so it surfaces + // via the thread's uncaught exception handler, rather than silently vanishing + Thread.currentThread().uncaughtExceptionHandler?.uncaughtException(Thread.currentThread(), error) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt index 7361c97b..e5333075 100644 --- a/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt @@ -11,10 +11,12 @@ import io.reactivex.exceptions.UndeliverableException import io.reactivex.plugins.RxJavaPlugins import okhttp3.mockwebserver.MockWebServer import org.junit.After +import org.junit.Assert.assertSame import org.junit.Before import org.junit.Rule import org.junit.Test import java.io.IOException +import java.net.SocketTimeoutException class ConstructorIoRxErrorHandlerTest { @@ -80,14 +82,43 @@ class ConstructorIoRxErrorHandlerTest { } @Test - fun handlesUnexpectedException() { - // Should not throw - unexpected exceptions are logged but don't crash - RxJavaPlugins.onError(UndeliverableException(IllegalStateException("unexpected error"))) + fun handlesSocketTimeoutException() { + // Should not throw - SocketTimeoutException is a subclass of IOException + RxJavaPlugins.onError(UndeliverableException(SocketTimeoutException("connect timed out"))) } @Test - fun handlesUndeliverableExceptionWithNullCause() { - // Should not throw - UndeliverableException with no cause - RxJavaPlugins.onError(UndeliverableException(null)) + fun forwardsUnexpectedExceptionToUncaughtExceptionHandler() { + val original = Thread.currentThread().uncaughtExceptionHandler + try { + var caughtThrowable: Throwable? = null + Thread.currentThread().uncaughtExceptionHandler = + Thread.UncaughtExceptionHandler { _, throwable -> caughtThrowable = throwable } + + val error = IllegalStateException("unexpected error") + RxJavaPlugins.onError(UndeliverableException(error)) + + assertSame(error, caughtThrowable) + } finally { + Thread.currentThread().uncaughtExceptionHandler = original + } + } + + @Test + fun forwardsNullCauseExceptionToUncaughtExceptionHandler() { + val original = Thread.currentThread().uncaughtExceptionHandler + try { + var caughtThrowable: Throwable? = null + Thread.currentThread().uncaughtExceptionHandler = + Thread.UncaughtExceptionHandler { _, throwable -> caughtThrowable = throwable } + + val error = UndeliverableException(null) + RxJavaPlugins.onError(error) + + // When cause is null, the UndeliverableException itself is forwarded + assertSame(error, caughtThrowable) + } finally { + Thread.currentThread().uncaughtExceptionHandler = original + } } } From 599576a77fff7ce6920b0593c399083a7507220c Mon Sep 17 00:00:00 2001 From: Hossam Hindawy Date: Thu, 12 Mar 2026 20:23:48 +0200 Subject: [PATCH 6/7] fall back to the JVM default exception handler if the thread has none set + add comments --- .../java/io/constructor/core/ConstructorIo.kt | 13 +++-- .../core/ConstructorIoRxErrorHandlerTest.kt | 53 +++++-------------- 2 files changed, 21 insertions(+), 45 deletions(-) diff --git a/library/src/main/java/io/constructor/core/ConstructorIo.kt b/library/src/main/java/io/constructor/core/ConstructorIo.kt index dab049a6..9cbc1de1 100755 --- a/library/src/main/java/io/constructor/core/ConstructorIo.kt +++ b/library/src/main/java/io/constructor/core/ConstructorIo.kt @@ -113,8 +113,8 @@ object ConstructorIo { } this.context = context.applicationContext - // Set up RxJava global error handler to prevent crashes from undeliverable exceptions. - // This handles network errors that occur after the RxJava chain has completed/disposed. + // Install the error handler early, before component initialization triggers the Dagger + // graph, so that any undeliverable RxJava exceptions during init are also caught. setupRxJavaErrorHandler() configMemoryHolder = component.configMemoryHolder() @@ -144,6 +144,7 @@ object ConstructorIo { * already completed or been disposed, particularly with OkHttp async operations. */ internal fun setupRxJavaErrorHandler() { + if (RxJavaPlugins.getErrorHandler() != null) return RxJavaPlugins.setErrorHandler { throwable -> var error = throwable // Unwrap the actual cause from UndeliverableException @@ -158,9 +159,11 @@ object ConstructorIo { return@setErrorHandler } - // Unexpected exception — re-throw on the current thread so it surfaces - // via the thread's uncaught exception handler, rather than silently vanishing - Thread.currentThread().uncaughtExceptionHandler?.uncaughtException(Thread.currentThread(), error) + // Unexpected exception — forward to the thread's uncaught exception handler, + // falling back to the JVM default handler if the thread has none set + val handler = Thread.currentThread().uncaughtExceptionHandler + ?: Thread.getDefaultUncaughtExceptionHandler() + handler?.uncaughtException(Thread.currentThread(), error) } } diff --git a/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt index e5333075..570c9e13 100644 --- a/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt @@ -1,68 +1,41 @@ package io.constructor.core -import android.content.Context -import io.constructor.data.local.PreferencesHelper -import io.constructor.data.memory.ConfigMemoryHolder -import io.constructor.test.createTestDataManager -import io.constructor.util.RxSchedulersOverrideRule -import io.mockk.every -import io.mockk.mockk import io.reactivex.exceptions.UndeliverableException +import io.reactivex.functions.Consumer import io.reactivex.plugins.RxJavaPlugins -import okhttp3.mockwebserver.MockWebServer import org.junit.After import org.junit.Assert.assertSame import org.junit.Before -import org.junit.Rule import org.junit.Test import java.io.IOException import java.net.SocketTimeoutException class ConstructorIoRxErrorHandlerTest { - @Rule - @JvmField - val overrideSchedulersRule = RxSchedulersOverrideRule() - - private lateinit var mockServer: MockWebServer private var constructorIo = ConstructorIo - private val ctx = mockk() - private val preferencesHelper = mockk() - private val configMemoryHolder = mockk() @Before fun setup() { - mockServer = MockWebServer() - mockServer.start() - - every { ctx.applicationContext } returns ctx - - every { preferencesHelper.apiKey } returns "golden-key" - every { preferencesHelper.id } returns "guido-the-guid" - every { preferencesHelper.serviceUrl } returns mockServer.hostName - every { preferencesHelper.port } returns mockServer.port - every { preferencesHelper.scheme } returns "http" - every { preferencesHelper.defaultItemSection } returns "Products" - every { preferencesHelper.getSessionId(any(), any()) } returns 79 - - every { configMemoryHolder.autocompleteResultCount } returns null - every { configMemoryHolder.userId } returns "player-one" - every { configMemoryHolder.testCellParams } returns emptyList() - every { configMemoryHolder.segments } returns emptyList() - - val config = ConstructorIoConfig("dummyKey") - val dataManager = createTestDataManager(preferencesHelper, configMemoryHolder) - - constructorIo.testInit(ctx, config, dataManager, preferencesHelper, configMemoryHolder) + RxJavaPlugins.reset() constructorIo.setupRxJavaErrorHandler() } @After fun teardown() { - mockServer.shutdown() RxJavaPlugins.reset() } + @Test + fun doesNotOverwriteExistingErrorHandler() { + RxJavaPlugins.reset() + val existingHandler = Consumer { } + RxJavaPlugins.setErrorHandler(existingHandler) + + constructorIo.setupRxJavaErrorHandler() + + assertSame(existingHandler, RxJavaPlugins.getErrorHandler()) + } + @Test fun handlesUndeliverableIOException() { // Should not throw - IOException is handled gracefully From 1cb75a0edf225585b4a6438958019b05ade4b53f Mon Sep 17 00:00:00 2001 From: Hossam Hindawy Date: Thu, 12 Mar 2026 21:04:05 +0200 Subject: [PATCH 7/7] restore the interrupt flag for InterruptedExceptions + add more tests --- .../java/io/constructor/core/ConstructorIo.kt | 19 ++++++++++--- .../core/ConstructorIoRxErrorHandlerTest.kt | 27 +++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/io/constructor/core/ConstructorIo.kt b/library/src/main/java/io/constructor/core/ConstructorIo.kt index 9cbc1de1..afdc05d6 100755 --- a/library/src/main/java/io/constructor/core/ConstructorIo.kt +++ b/library/src/main/java/io/constructor/core/ConstructorIo.kt @@ -152,18 +152,31 @@ object ConstructorIo { error = error.cause ?: error } + // InterruptedException signals the thread should stop — restore the interrupt flag + // so cooperative cancellation continues to work, then return without crashing + if (error is InterruptedException) { + Thread.currentThread().interrupt() + e("Constructor.io: Non-fatal interrupted error: ${error.message}") + return@setErrorHandler + } + // Network exceptions are expected during normal operation (timeout, no connectivity, etc.) // Log them but don't crash the app - if (error is IOException || error is InterruptedException) { + if (error is IOException) { e("Constructor.io: Non-fatal network error: ${error.javaClass.simpleName} - ${error.message}") return@setErrorHandler } // Unexpected exception — forward to the thread's uncaught exception handler, - // falling back to the JVM default handler if the thread has none set + // falling back to the JVM default handler if the thread has none set. + // If no handler is available, log the error. val handler = Thread.currentThread().uncaughtExceptionHandler ?: Thread.getDefaultUncaughtExceptionHandler() - handler?.uncaughtException(Thread.currentThread(), error) + if (handler != null) { + handler.uncaughtException(Thread.currentThread(), error) + } else { + e("Constructor.io: Undeliverable unexpected exception (no uncaught handler): $error") + } } } diff --git a/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt b/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt index 570c9e13..bb30641e 100644 --- a/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt +++ b/library/src/test/java/io/constructor/core/ConstructorIoRxErrorHandlerTest.kt @@ -5,6 +5,7 @@ import io.reactivex.functions.Consumer import io.reactivex.plugins.RxJavaPlugins import org.junit.After import org.junit.Assert.assertSame +import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test import java.io.IOException @@ -25,6 +26,13 @@ class ConstructorIoRxErrorHandlerTest { RxJavaPlugins.reset() } + @Test + fun isIdempotent() { + val handlerAfterFirstCall = RxJavaPlugins.getErrorHandler() + constructorIo.setupRxJavaErrorHandler() + assertSame(handlerAfterFirstCall, RxJavaPlugins.getErrorHandler()) + } + @Test fun doesNotOverwriteExistingErrorHandler() { RxJavaPlugins.reset() @@ -45,7 +53,10 @@ class ConstructorIoRxErrorHandlerTest { @Test fun handlesUndeliverableInterruptedException() { // Should not throw - InterruptedException is handled gracefully + // and the interrupt flag should be restored on the current thread + Thread.interrupted() // clear any pre-existing interrupt flag RxJavaPlugins.onError(UndeliverableException(InterruptedException("thread interrupted"))) + assertTrue("Interrupt flag should be restored", Thread.interrupted()) } @Test @@ -77,6 +88,22 @@ class ConstructorIoRxErrorHandlerTest { } } + @Test + fun logsUnexpectedExceptionWhenNoUncaughtHandler() { + val original = Thread.currentThread().uncaughtExceptionHandler + val defaultHandler = Thread.getDefaultUncaughtExceptionHandler() + try { + Thread.currentThread().uncaughtExceptionHandler = null + Thread.setDefaultUncaughtExceptionHandler(null) + + // Should not throw — falls back to logging when both handlers are null + RxJavaPlugins.onError(UndeliverableException(IllegalStateException("no handler"))) + } finally { + Thread.currentThread().uncaughtExceptionHandler = original + Thread.setDefaultUncaughtExceptionHandler(defaultHandler) + } + } + @Test fun forwardsNullCauseExceptionToUncaughtExceptionHandler() { val original = Thread.currentThread().uncaughtExceptionHandler