@@ -109,27 +109,8 @@ func TestRevertTileAndTerrainProviders_TileReversions(t *testing.T) {
109109 },
110110 }
111111
112- // Test case 5: carto_light → stamen_toner
112+ // Test case 5: open_street_map → esri_world_topo
113113 doc5 := bson.M {
114- "_id" : primitive .NewObjectID (),
115- "items" : bson.A {
116- bson.M {
117- "groups" : bson.A {
118- bson.M {
119- "fields" : bson.A {
120- bson.M {
121- "field" : "tile_type" ,
122- "value" : "carto_light" ,
123- },
124- },
125- },
126- },
127- },
128- },
129- }
130-
131- // Test case 6: open_street_map → esri_world_topo
132- doc6 := bson.M {
133114 "_id" : primitive .NewObjectID (),
134115 "items" : bson.A {
135116 bson.M {
@@ -148,7 +129,7 @@ func TestRevertTileAndTerrainProviders_TileReversions(t *testing.T) {
148129 }
149130
150131 // Test case 7: cesium_ion with different asset_id should not be changed
151- doc7 := bson.M {
132+ doc6 := bson.M {
152133 "_id" : primitive .NewObjectID (),
153134 "items" : bson.A {
154135 bson.M {
@@ -171,7 +152,7 @@ func TestRevertTileAndTerrainProviders_TileReversions(t *testing.T) {
171152 }
172153
173154 // Insert test documents
174- _ , err := db .Collection ("property" ).InsertMany (ctx , []any {doc1 , doc2 , doc3 , doc4 , doc5 , doc6 , doc7 })
155+ _ , err := db .Collection ("property" ).InsertMany (ctx , []any {doc1 , doc2 , doc3 , doc4 , doc5 , doc6 })
175156 require .NoError (t , err )
176157
177158 // Run revert migration
@@ -214,28 +195,21 @@ func TestRevertTileAndTerrainProviders_TileReversions(t *testing.T) {
214195 assert .Equal (t , "tile_type" , fields4 [0 ].(bson.M )["field" ])
215196 assert .Equal (t , "black_marble" , fields4 [0 ].(bson.M )["value" ])
216197
217- // Verify doc5: carto_light → stamen_toner
198+ // Verify doc5: open_street_map → esri_world_topo
218199 var updatedDoc5 bson.M
219200 err = db .Collection ("property" ).FindOne (ctx , bson.M {"_id" : doc5 ["_id" ]}).Decode (& updatedDoc5 )
220201 require .NoError (t , err )
221202 value5 := updatedDoc5 ["items" ].(primitive.A )[0 ].(bson.M )["groups" ].(primitive.A )[0 ].(bson.M )["fields" ].(primitive.A )[0 ].(bson.M )["value" ]
222- assert .Equal (t , "stamen_toner " , value5 )
203+ assert .Equal (t , "esri_world_topo " , value5 )
223204
224- // Verify doc6: open_street_map → esri_world_topo
205+ // Verify doc6: cesium_ion with asset_id 999 unchanged
225206 var updatedDoc6 bson.M
226207 err = db .Collection ("property" ).FindOne (ctx , bson.M {"_id" : doc6 ["_id" ]}).Decode (& updatedDoc6 )
227208 require .NoError (t , err )
228- value6 := updatedDoc6 ["items" ].(primitive.A )[0 ].(bson.M )["groups" ].(primitive.A )[0 ].(bson.M )["fields" ].(primitive.A )[0 ].(bson.M )["value" ]
229- assert .Equal (t , "esri_world_topo" , value6 )
230-
231- // Verify doc7: cesium_ion with asset_id 999 unchanged
232- var updatedDoc7 bson.M
233- err = db .Collection ("property" ).FindOne (ctx , bson.M {"_id" : doc7 ["_id" ]}).Decode (& updatedDoc7 )
234- require .NoError (t , err )
235- fields7 := updatedDoc7 ["items" ].(primitive.A )[0 ].(bson.M )["groups" ].(primitive.A )[0 ].(bson.M )["fields" ].(primitive.A )
236- assert .Len (t , fields7 , 2 )
237- assert .Equal (t , "cesium_ion" , fields7 [0 ].(bson.M )["value" ])
238- assert .Equal (t , float64 (999 ), fields7 [1 ].(bson.M )["value" ])
209+ fields6 := updatedDoc6 ["items" ].(primitive.A )[0 ].(bson.M )["groups" ].(primitive.A )[0 ].(bson.M )["fields" ].(primitive.A )
210+ assert .Len (t , fields6 , 2 )
211+ assert .Equal (t , "cesium_ion" , fields6 [0 ].(bson.M )["value" ])
212+ assert .Equal (t , float64 (999 ), fields6 [1 ].(bson.M )["value" ])
239213}
240214
241215func TestRevertTileAndTerrainProviders_TerrainReversions (t * testing.T ) {
@@ -418,7 +392,7 @@ func TestRevertTileAndTerrainProviders_MultipleTilesInDocument(t *testing.T) {
418392 "fields" : bson.A {
419393 bson.M {
420394 "field" : "tile_type" ,
421- "value" : "carto_light " ,
395+ "value" : "open_street_map " ,
422396 },
423397 },
424398 },
@@ -458,9 +432,9 @@ func TestRevertTileAndTerrainProviders_MultipleTilesInDocument(t *testing.T) {
458432 assert .Len (t , fields1 , 1 )
459433 assert .Equal (t , "default" , fields1 [0 ].(bson.M )["value" ])
460434
461- // Check second tile (carto_light → stamen_toner )
435+ // Check second tile (open_street_map → esri_world_topo )
462436 fields2 := items [0 ].(bson.M )["groups" ].(primitive.A )[1 ].(bson.M )["fields" ].(primitive.A )
463- assert .Equal (t , "stamen_toner " , fields2 [0 ].(bson.M )["value" ])
437+ assert .Equal (t , "esri_world_topo " , fields2 [0 ].(bson.M )["value" ])
464438
465439 // Check terrain (reearth_terrain → arcgis)
466440 fields3 := items [1 ].(bson.M )["groups" ].(primitive.A )[0 ].(bson.M )["fields" ].(primitive.A )
0 commit comments