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:
sarahcaseybot
2023-04-10 14:43:56 -04:00
committed by GitHub
parent 79ba1b94c4
commit d17678959c
4 changed files with 54 additions and 4 deletions
@@ -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");
}