mirror of
https://github.com/google/nomulus
synced 2026-09-20 15:04:24 +00:00
Add tool commands to modify TTLs on a TLD (#1985)
* Add tool commands to modify TTLs on a TLD * Small changes * Add an example to the parameter description
This commit is contained in:
@@ -76,6 +76,22 @@ class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
||||
.isEqualTo(Registry.DEFAULT_REGISTRY_LOCK_OR_UNLOCK_BILLING_COST);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_ttls() throws Exception {
|
||||
runCommandForced(
|
||||
"xn--q9jyb4c",
|
||||
"--roid_suffix=Q9JYB4C",
|
||||
"--dns_writers=FooDnsWriter",
|
||||
"--dns_a_plus_aaaa_ttl=PT300S",
|
||||
"--dns_ds_ttl=PT240S",
|
||||
"--dns_ns_ttl=PT180S");
|
||||
Registry registry = Registry.get("xn--q9jyb4c");
|
||||
assertThat(registry).isNotNull();
|
||||
assertThat(registry.getDnsAPlusAaaaTtl()).isEqualTo(standardMinutes(5));
|
||||
assertThat(registry.getDnsDsTtl()).isEqualTo(standardMinutes(4));
|
||||
assertThat(registry.getDnsNsTtl()).isEqualTo(standardMinutes(3));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_multipleArguments() {
|
||||
IllegalArgumentException thrown =
|
||||
|
||||
@@ -1095,6 +1095,19 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||
assertThat(thrown).hasMessageThat().contains("The premium list 'phonies' doesn't exist");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_setTtls() throws Exception {
|
||||
runCommandForced(
|
||||
"--dns_a_plus_aaaa_ttl=PT300S",
|
||||
"--dns_ds_ttl=PT240S",
|
||||
"--dns_ns_ttl=PT180S",
|
||||
"xn--q9jyb4c");
|
||||
Registry registry = Registry.get("xn--q9jyb4c");
|
||||
assertThat(registry.getDnsAPlusAaaaTtl()).isEqualTo(standardMinutes(5));
|
||||
assertThat(registry.getDnsDsTtl()).isEqualTo(standardMinutes(4));
|
||||
assertThat(registry.getDnsNsTtl()).isEqualTo(standardMinutes(3));
|
||||
}
|
||||
|
||||
private void runSuccessfulReservedListsTest(String reservedLists) throws Exception {
|
||||
runCommandForced("--reserved_lists", reservedLists, "xn--q9jyb4c");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user