@Test public void testZoneUpdate_ttlAndEmail() { ZoneUpdate command = new ZoneUpdate(); command.id = "denominator.io."; command.ttl = 3601; command.email = "nil@denominator.io"; Zone before = mgr.api().zones().iterateByName(command.id).next(); assertThat(command.doRun(mgr)).containsExactly( ";; updating zone denominator.io. with ttl 3601 and email nil@denominator.io", ";; ok"); assertThat(mgr.api().zones().iterateByName(before.name())) .contains(Zone.create(before.id(), before.name(), command.ttl, command.email)); }
static String id(DNSApiManager mgr, String zoneIdOrName) { if (zoneIdOrName.indexOf('.') == -1) { return zoneIdOrName; } if (zoneNameIsId(mgr.provider())) { return zoneIdOrName; } Iterator<Zone> result = mgr.api().zones().iterateByName(zoneIdOrName); checkArgument(result.hasNext(), "zone %s not found", zoneIdOrName); return result.next().id(); }
Denominator { static String id(DNSApiManager mgr, String zoneIdOrName) { if (zoneIdOrName.indexOf('.') == -1) { return zoneIdOrName; } if (zoneNameIsId(mgr.provider())) { return zoneIdOrName; } Iterator<Zone> result = mgr.api().zones().iterateByName(zoneIdOrName); checkArgument(result.hasNext(), "zone %s not found", zoneIdOrName); return result.next().id(); } }
Denominator { static String id(DNSApiManager mgr, String zoneIdOrName) { if (zoneIdOrName.indexOf('.') == -1) { return zoneIdOrName; } if (zoneNameIsId(mgr.provider())) { return zoneIdOrName; } Iterator<Zone> result = mgr.api().zones().iterateByName(zoneIdOrName); checkArgument(result.hasNext(), "zone %s not found", zoneIdOrName); return result.next().id(); }  }
Denominator { static String id(DNSApiManager mgr, String zoneIdOrName) { if (zoneIdOrName.indexOf('.') == -1) { return zoneIdOrName; } if (zoneNameIsId(mgr.provider())) { return zoneIdOrName; } Iterator<Zone> result = mgr.api().zones().iterateByName(zoneIdOrName); checkArgument(result.hasNext(), "zone %s not found", zoneIdOrName); return result.next().id(); }  static void main(String[] args); }
Denominator { static String id(DNSApiManager mgr, String zoneIdOrName) { if (zoneIdOrName.indexOf('.') == -1) { return zoneIdOrName; } if (zoneNameIsId(mgr.provider())) { return zoneIdOrName; } Iterator<Zone> result = mgr.api().zones().iterateByName(zoneIdOrName); checkArgument(result.hasNext(), "zone %s not found", zoneIdOrName); return result.next().id(); }  static void main(String[] args);  }