From d2971cf39a88d34a879d34463cc44e1dd9e55a84 Mon Sep 17 00:00:00 2001 From: Dzmitry Fomchyn <5161509+DzmitryFomchyn@users.noreply.github.com> Date: Thu, 22 Jun 2023 17:17:53 +0200 Subject: [PATCH] Update dependencies. SDK version bump (#157) --- CHANGELOG.md | 8 +- MapboxSearch/gradle.properties | 2 +- MapboxSearch/gradle/versions.gradle | 6 +- ...ions-data-formatting-corrections-test.json | 85 +++++++++++++++++++ .../search/CategorySearchIntegrationTest.kt | 2 +- .../LocalDataProvidersIntegrationTest.kt | 2 +- .../ReverseGeocodingSearchIntegrationTest.kt | 2 +- .../search/SearchEngineIntegrationTest.kt | 20 ++++- 8 files changed, 116 insertions(+), 11 deletions(-) create mode 100644 MapboxSearch/sdk/src/androidTest/assets/sbs_responses/suggestions-data-formatting-corrections-test.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cceb2a01..1d03bf80d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,18 @@ # Changelog for the Mapbox Search SDK for Android -## 1.0.0-rc.6-SNAPSHOT +## 1.0.0-rc.6 ### Breaking changes - [CORE] `SearchSuggestionType.IndexableRecordItem.type` field has been replaced with `record` field which provides `IndexableRecord` instance. ### Bug fixes - [CORE] Now search suggestions and search results that are matched with `IndexableRecord`s provide data from the backend which is likely to be up-to-date than data from `IndexableRecord`. Original `IndexableRecord` instance can be obtained from `SearchSuggestionType.IndexableRecordItem.record` and `SearchResult.indexableRecord`. +- [ALL] Fixed an issue where SBS backend doesn't always capitilized street names for POI results. +- [ALL] Fixed an issue where some POI results from SBS backend were missing "Ave/St/Avenue/Street" words in street names. ### Mapbox dependencies -- Search Native SDK `0.69.0` -- Common SDK `23.6.0-rc.1` +- Search Native SDK `0.70.0` +- Common SDK `23.6.0` - Kotlin `1.5.31` diff --git a/MapboxSearch/gradle.properties b/MapboxSearch/gradle.properties index b6852b5a8..e0bacdefb 100644 --- a/MapboxSearch/gradle.properties +++ b/MapboxSearch/gradle.properties @@ -21,7 +21,7 @@ android.enableJetifier=false kotlin.code.style=official # SDK version attributes -VERSION_NAME=1.0.0-rc.6-SNAPSHOT +VERSION_NAME=1.0.0-rc.6 # Artifact attributes mapboxArtifactUserOrg=mapbox diff --git a/MapboxSearch/gradle/versions.gradle b/MapboxSearch/gradle/versions.gradle index f04766857..0a29821ae 100644 --- a/MapboxSearch/gradle/versions.gradle +++ b/MapboxSearch/gradle/versions.gradle @@ -41,11 +41,11 @@ ext { pitest_version = '1.6.7' - mapbox_maps_version = '10.14.0-rc.1' - common_sdk_version = '23.6.0-rc.1' + mapbox_maps_version = '10.14.0' + common_sdk_version = '23.6.0' mapbox_base_version = '0.8.0' - search_native_version = '0.69.0' + search_native_version = '0.70.0' detekt_version = '1.19.0' diff --git a/MapboxSearch/sdk/src/androidTest/assets/sbs_responses/suggestions-data-formatting-corrections-test.json b/MapboxSearch/sdk/src/androidTest/assets/sbs_responses/suggestions-data-formatting-corrections-test.json new file mode 100644 index 000000000..0fc0ea1c0 --- /dev/null +++ b/MapboxSearch/sdk/src/androidTest/assets/sbs_responses/suggestions-data-formatting-corrections-test.json @@ -0,0 +1,85 @@ +{ + "suggestions": [ + { + "feature_name": "667 Madison", + "matching_name": "667 Madison", + "highlighted_name": "667 Madison,New York City,madison ave,New York", + "description": "667 Madison Ave, New York City, New York 10065, United States of America", + "result_type": [ + "poi" + ], + "language": "en", + "action": { + "endpoint": "retrieve", + "method": "POST", + "body": { + "id": "0pDj_Rew9CLUO8R2UnOKPup2ZJZuWwQpNNTqyTGmGB1WTC30P0_sht2U3w7UOiTI4H1681Oq4MPdoT93OZOI5q7nwmuBm8TYKZuSCGybp2VH0rXMM8k7hBGxgwLggoQGzRh4qOQRnKM2EtcbxLM-tb5aQeC_NiGWX5aa_8ZWcRcFwxGhQ-8GxBuY-f2EzBOVUu1ACpUZIzmiaft27CZiaxIFEuut89nTyk_k_yFCcVhF5xFodu5YHIWFhbmHbYolnATIjVhguYVUqXlDpGroxY3PLh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W4eIvkNAPMAKfv1UuPBdhi3MrIofYtj_nq0c-cv-H90b6OILxFjHF2fZYixLRepzJHUnBYXOSzFLW7LmrszlGCw20Nzv3p2FYZWFyXunSlt6mgg3jrHtIKQep8bGsPNkVumPl_hovpmQE-NGrwmznZI5bps4jLW16GvMdgZBUWSnSKN4IF_0RqNT7BBLO2iI2qY40SmT6UlkS-Qwjgm9uJQBekv6wsAkYItW_QnLKlsyghHOVR5x9PI9XaoqDJ59B1ObxwQyyH2nan6rT57h0V1YooYegCzBfDrSNmIBgqurHvAawlvl1k69aQwaOnRkdfXr76QbGB7iq3xWUYRa6tGhV52sA69n_0pm3DTYnMRzgLgi4cPhzY9q_NKpEEBMuGmnkGcGzRNaxNfNz2ShtUa6voxh6_YN1cI_KonSRx7WUlF0vdUNzX5ZRxPQSWC-5dhECPnemlRyXMe6i2dZQ1hCM5nnuya0DKoO9tKJpLYsyMPRebv5RXxV3rKw_WVd4mPxFm2NmFO09sL-NNwY8V7Oz1DzIBASMzZfj0azUIxcBpc9X1HjJnQ_e2VxNkEAN3zBaxF7Vr5z8ULCNMFEVEN4TqO7BVrajELWEmYJzPw=" + }, + "multi_retrievable": true + }, + "coordinates": "-73.970262,40.764425", + "routable_points": [ + { + "name": "POI", + "coordinates": [ + -73.97061240745133, + 40.764688323942714 + ] + } + ], + "maki": "marker", + "category": [ + "office" + ], + "category_ids": [ + "office" + ], + "internal_id": "Y2aAgIL8TAA=.42eAgMSCTN2C_Ezd4tSisszkVAA=.U2aAgLT80qLiwtLEolQ9k8SUVHMjA9M0SzOTRFMjg9RUc1Mjw1RjAA==", + "external_ids": { + "foursquare": "4ade7205f964a520ee7521e3", + "federated": "poi.b064d09463365d08f3d3ec6b54e1e9673e157cf65b0dbb4fb7c38c6343d404ff", + "mbx_poi": "b064d09463365d08f3d3ec6b54e1e9673e157cf65b0dbb4fb7c38c6343d404ff" + }, + "mapbox_id": "CkIKQGIwNjRkMDk0NjMzNjVkMDhmM2QzZWM2YjU0ZTFlOTY3M2UxNTdjZjY1YjBkYmI0ZmI3YzM4YzYzNDNkNDA0ZmY=", + "context": [ + { + "layer": "address", + "localized_layer": "address", + "name": "667 Madison Ave" + }, + { + "layer": "street", + "localized_layer": "street", + "name": "madison ave" + }, + { + "layer": "postcode", + "localized_layer": "postcode", + "name": "10065" + }, + { + "layer": "place", + "localized_layer": "place", + "name": "New York City" + }, + { + "layer": "region", + "localized_layer": "region", + "name": "New York" + }, + { + "layer": "country", + "localized_layer": "country", + "name": "United States of America" + } + ], + "metadata": { + "iso_3166_1": "US", + "iso_3166_2": "US-NY" + } + } + ], + "attribution": "© 2023 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", + "version": "141:f9a22b62836e23acbb9bf1fc5a7b63c46cd301ce", + "response_uuid": "836c2755-59c5-4798-8493-4fe37edd2b62" +} \ No newline at end of file diff --git a/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/CategorySearchIntegrationTest.kt b/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/CategorySearchIntegrationTest.kt index 6ba4fad52..834092a13 100644 --- a/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/CategorySearchIntegrationTest.kt +++ b/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/CategorySearchIntegrationTest.kt @@ -196,7 +196,7 @@ internal class CategorySearchIntegrationTest : BaseTest() { place = "Mountain View", postcode = "94041", region = "California", - street = "castro st" + street = "Castro St" ) ), fullAddress = "750 Castro St, Mountain View, California 94041, United States of America", diff --git a/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/LocalDataProvidersIntegrationTest.kt b/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/LocalDataProvidersIntegrationTest.kt index cb838b941..21111da90 100644 --- a/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/LocalDataProvidersIntegrationTest.kt +++ b/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/LocalDataProvidersIntegrationTest.kt @@ -125,7 +125,7 @@ internal class LocalDataProvidersIntegrationTest : BaseTest() { place = "San Jose", postcode = "95117", region = "California", - street = "stevens creek blvd", + street = "Stevens Creek Blvd", neighborhood = "Valley Fair", houseNumber = "3249", country = "United States of America" diff --git a/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/ReverseGeocodingSearchIntegrationTest.kt b/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/ReverseGeocodingSearchIntegrationTest.kt index dc86f23c4..df91e8899 100644 --- a/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/ReverseGeocodingSearchIntegrationTest.kt +++ b/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/ReverseGeocodingSearchIntegrationTest.kt @@ -161,7 +161,7 @@ internal class ReverseGeocodingSearchIntegrationTest : BaseTest() { neighborhood = "Gros-Caillou", place = "Paris", postcode = "75007", - street = "avenue anatole france" + street = "Avenue Anatole France" ) ), fullAddress = "5 Avenue Anatole France, 75007 Paris, France", diff --git a/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/SearchEngineIntegrationTest.kt b/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/SearchEngineIntegrationTest.kt index 5e68b55e1..5e8376c21 100644 --- a/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/SearchEngineIntegrationTest.kt +++ b/MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/SearchEngineIntegrationTest.kt @@ -517,7 +517,7 @@ internal class SearchEngineIntegrationTest : BaseTest() { place = "San Francisco", neighborhood = "Downtown", postcode = "94102", - street = "van ness", + street = "Van Ness", houseNumber = "150" ), searchResultType = SearchResultType.ADDRESS, @@ -1151,6 +1151,24 @@ internal class SearchEngineIntegrationTest : BaseTest() { assertEquals("667 Madison Ave, New York City, New York 10065, United States of America", suggestion.fullAddress) } + @Test + fun testSbsBackendDataCorrections() { + /** + * For some results backend sends incorrectly formatted fields. Search SDK tries to patch such data: + * (SSDK-276) street: madison ave -> Madison Ave + * (SSDK-277) name: 667 Madison -> 667 Madison Ave + */ + mockServer.enqueue(createSuccessfulResponse("sbs_responses/suggestions-data-formatting-corrections-test.json")) + + val suggestionsResponse = searchEngine.searchBlocking(TEST_QUERY, SearchOptions()) + + val suggestions = suggestionsResponse.requireSuggestions() + val suggestion = suggestions.first() + + assertEquals("667 Madison Ave", suggestion.name) + assertEquals("Madison Ave", suggestion.address?.street) + } + @Test fun testGeocodingCzechAddressFormatting() { searchEngine = SearchEngine.createSearchEngine(ApiType.GEOCODING, searchEngineSettings)