Skip to content

Commit 7efa836

Browse files
authored
feat(places): Replace deprecated Place.Type and Place.address (#281)
* feat(places): Replace deprecated Place.address with formattedAddress The Place.address field has been deprecated in the Places SDK. This commit replaces its usage in the test suite with the recommended formattedAddress field. * style: Add missing newline at end of file
1 parent 6643038 commit 7efa836

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

places-ktx/src/test/java/com/google/android/libraries/places/ktx/model/AutocompletePredictionTest.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
package com.google.android.libraries.places.ktx.model
1818

19-
import com.google.android.libraries.places.api.model.Place
19+
20+
import com.google.android.libraries.places.api.model.PlaceTypes
2021
import com.google.android.libraries.places.ktx.api.model.autocompletePrediction
2122
import org.junit.Assert.assertEquals
2223
import org.junit.Test
@@ -25,10 +26,10 @@ internal class AutocompletePredictionTest {
2526
@Test
2627
fun testBuilder() {
2728
val prediction = autocompletePrediction("placeId") {
28-
placeTypes = listOf(Place.Type.AQUARIUM)
29+
types = listOf(PlaceTypes.AQUARIUM)
2930
}
3031
val res = prediction.getPrimaryText(null)
3132
assertEquals("placeId", prediction.placeId)
32-
assertEquals(listOf(Place.Type.AQUARIUM), prediction.placeTypes)
33+
assertEquals(listOf(PlaceTypes.AQUARIUM), prediction.types)
3334
}
34-
}
35+
}

places-ktx/src/test/java/com/google/android/libraries/places/ktx/model/PlaceTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal class PlaceTest {
2525
@Test
2626
fun testBuilder() {
2727
val place = place {
28-
address = "address"
28+
formattedAddress = "address"
2929
addressComponents = AddressComponents.newInstance(
3030
listOf(
3131
addressComponent("Main Street", listOf("street_address")) {
@@ -34,7 +34,7 @@ internal class PlaceTest {
3434
)
3535
)
3636
}
37-
assertEquals("address", place.address)
37+
assertEquals("address", place.formattedAddress)
3838
assertEquals(AddressComponents.newInstance(
3939
listOf(
4040
addressComponent("Main Street", listOf("street_address")) {

0 commit comments

Comments
 (0)