mirror of
https://github.com/google/nomulus
synced 2026-09-06 16:17:13 +00:00
Improve error when creating domain label lists for non-existent TLDs (#1112)
* Improve error message when creating domain label lists for non-existent TLDs
This commit is contained in:
@@ -113,7 +113,9 @@ class CreateReservedListCommandTest
|
||||
|
||||
@Test
|
||||
void testNamingRules_tldThatDoesNotExist_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("footld_reserved-list", "TLD footld does not exist");
|
||||
runNameTestExpectedFailure(
|
||||
"footld_reserved-list",
|
||||
"The name must be in the format {tld|common}_list-name, yet TLD footld does not exist");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -153,7 +155,9 @@ class CreateReservedListCommandTest
|
||||
|
||||
@Test
|
||||
void testNamingRules_commonAsListName_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("invalidtld_common", "TLD invalidtld does not exist");
|
||||
runNameTestExpectedFailure(
|
||||
"invalidtld_common",
|
||||
"The name must be in the format {tld|common}_list-name, yet TLD invalidtld does not exist");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -70,6 +70,18 @@ public class CreatePremiumListActionTest {
|
||||
assertThat(error).contains("A premium list of this name already exists");
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_nonExistentTld_fails() {
|
||||
action.name = "zanzibar";
|
||||
action.inputData = "zanzibar,USD 100";
|
||||
action.run();
|
||||
assertThat(response.getResponseMap().get("status")).isEqualTo("error");
|
||||
assertThat(response.getResponseMap().get("error").toString())
|
||||
.isEqualTo(
|
||||
"Premium names must match the name of the TLD they are intended to be used on"
|
||||
+ " (unless --override is specified), yet TLD zanzibar does not exist");
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_nonExistentTld_successWithOverride() {
|
||||
action.name = "zanzibar";
|
||||
|
||||
Reference in New Issue
Block a user