@Test public void setKey() throws Exception { ZoneFixtures.withUpdateableZone(client(), zone -> { final String newKey = randomKey(); assertThat(zone.getKey()).isNotEqualTo(newKey); final ZoneUpdateCommand command = ZoneUpdateCommand.of(zone, SetKey.of(newKey)); final Zone updatedZone = client().executeBlocking(command); assertThat(updatedZone.getKey()).isEqualTo(newKey); return updatedZone; }, CountryCode.AM); }
@Test public void updateByKey() throws Exception { ZoneFixtures.withUpdateableZone(client(), zone -> { final String newKey = randomKey(); assertThat(zone.getKey()).isNotEqualTo(newKey); final ZoneUpdateCommand command = ZoneUpdateCommand.of(zone, SetKey.of(newKey)); final Zone updatedZone = client().executeBlocking(command); assertThat(updatedZone.getKey()).isEqualTo(newKey); final String newKey2 = randomKey(); final ZoneUpdateCommand commandByKey = ZoneUpdateCommand.ofKey(updatedZone.getKey(),updatedZone.getVersion(), SetKey.of(newKey2)); final Zone updatedZone2 = client().executeBlocking(commandByKey); assertThat(updatedZone2.getKey()).isEqualTo(newKey2); return updatedZone2; }, CountryCode.AM); }