Fix type of location coordinates (#36)

This commit is contained in:
Ignasi Barrera 2019-06-15 09:01:13 +02:00
parent ac175f069f
commit 590d0509cc
No known key found for this signature in database
GPG Key ID: 3D5414A0D959B94F
2 changed files with 5 additions and 5 deletions

View File

@ -42,16 +42,16 @@ public abstract class Location {
/** /**
* The longitude of the datacenter * The longitude of the datacenter
*/ */
public abstract double longitude(); public abstract String longitude();
/** /**
* The latitude of the datacenter * The latitude of the datacenter
*/ */
public abstract double latitude(); public abstract String latitude();
@SerializedNames({"id", "name", "displayName", "longitude", "latitude"}) @SerializedNames({"id", "name", "displayName", "longitude", "latitude"})
public static Location create(final String id, final String name, final String displayName, final double longitude, public static Location create(final String id, final String name, final String displayName, final String longitude,
final double latitude) { final String latitude) {
return new AutoValue_Location(id, name, displayName, longitude, latitude); return new AutoValue_Location(id, name, displayName, longitude, latitude);
} }

View File

@ -33,7 +33,7 @@ public class LocationApiMockTest extends BaseAzureComputeApiMockTest {
final LocationApi locationAPI = api.getLocationApi(); final LocationApi locationAPI = api.getLocationApi();
assertEquals(locationAPI.list(), ImmutableList.of( assertEquals(locationAPI.list(), ImmutableList.of(
Location.create("/subscriptions/SUBSCRIPTIONID/locations/eastasia", Location.create("/subscriptions/SUBSCRIPTIONID/locations/eastasia",
"eastasia", "East Asia", 114.188, 22.267) "eastasia", "East Asia", "114.188", "22.267")
)); ));
assertSent(server, "GET", "/subscriptions/SUBSCRIPTIONID/locations?api-version=2015-11-01"); assertSent(server, "GET", "/subscriptions/SUBSCRIPTIONID/locations?api-version=2015-11-01");
} }