public final class AddLocation extends UpdateActionImpl<Zone>
See also ZoneUpdateCommand.
ZoneFixtures.withUpdateableZone(client(), zone -> {
//adding a location
final Location newLocation = Location.of(CountryCode.AQ, "state");
assertThat(zone.getLocations().contains(newLocation)).isFalse();
final ZoneUpdateCommand addCommand = ZoneUpdateCommand.of(zone, AddLocation.of(newLocation));
final Zone zoneWithNewLocation = client().executeBlocking(addCommand);
assertThat(zoneWithNewLocation.getLocations()).contains(newLocation);
//removing a location
final ZoneUpdateCommand removeCommand = ZoneUpdateCommand.of(zoneWithNewLocation, RemoveLocation.of(newLocation));
final Zone zoneWithoutNewLocation = client().executeBlocking(removeCommand);
assertThat(zoneWithoutNewLocation.getLocations().contains(newLocation)).isFalse();
return zoneWithoutNewLocation;
}, CountryCode.AO);
See the test code.
Zone.getLocations()
Modifier and Type | Method and Description |
---|---|
Location |
getLocation() |
static AddLocation |
of(Location location) |
getAction
public static AddLocation of(Location location)
public Location getLocation()