mirror of
https://github.com/google/nomulus
synced 2026-09-01 13:46:55 +00:00
Add a check so newly saved createCostTransitions get recognized and saved to the database (#2335)
* Add a check so newly saved createCostTransitions get recognized and saved to the database * Fix equals check * Rename equals method * Add comment explaining need for createBillingCostTransitionEqualCheck
This commit is contained in:
@@ -140,6 +140,8 @@ public class ConfigureTldCommandTest extends CommandTestCase<ConfigureTldCommand
|
||||
tld.asBuilder()
|
||||
.setIdnTables(ImmutableSet.of(JA, UNCONFUSABLE_LATIN, EXTENDED_LATIN))
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("zeta", "alpha", "gamma", "beta"))
|
||||
.setCreateBillingCostTransitions(
|
||||
ImmutableSortedMap.of(START_OF_TIME, Money.of(USD, 13)))
|
||||
.build());
|
||||
File tldFile = tmpDir.resolve("idns.yaml").toFile();
|
||||
Files.asCharSink(tldFile, UTF_8).write(loadFile(getClass(), "idns.yaml"));
|
||||
@@ -149,6 +151,22 @@ public class ConfigureTldCommandTest extends CommandTestCase<ConfigureTldCommand
|
||||
.hasLogAtLevelWithMessage(INFO, "TLD YAML file contains no new changes");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_addCreateCostTransitions_hasDiff() throws Exception {
|
||||
Tld tld = createTld("idns");
|
||||
persistResource(
|
||||
tld.asBuilder()
|
||||
.setIdnTables(ImmutableSet.of(JA, UNCONFUSABLE_LATIN, EXTENDED_LATIN))
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("zeta", "alpha", "gamma", "beta"))
|
||||
.build());
|
||||
File tldFile = tmpDir.resolve("idns.yaml").toFile();
|
||||
Files.asCharSink(tldFile, UTF_8).write(loadFile(getClass(), "idns.yaml"));
|
||||
runCommandForced("--input=" + tldFile);
|
||||
Tld updatedTld = Tld.get("idns");
|
||||
testTldConfiguredSuccessfully(updatedTld, "idns.yaml");
|
||||
assertThat(tld.createBillingCostTransitionsEqual(updatedTld)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_outOfOrderFieldsOnCreate() throws Exception {
|
||||
File tldFile = tmpDir.resolve("outoforderfields.yaml").toFile();
|
||||
@@ -580,6 +598,8 @@ public class ConfigureTldCommandTest extends CommandTestCase<ConfigureTldCommand
|
||||
tld.asBuilder()
|
||||
.setIdnTables(ImmutableSet.of(JA, UNCONFUSABLE_LATIN, EXTENDED_LATIN))
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("zeta", "alpha", "gamma", "beta"))
|
||||
.setCreateBillingCostTransitions(
|
||||
ImmutableSortedMap.of(START_OF_TIME, Money.of(USD, 13)))
|
||||
.build());
|
||||
File tldFile = tmpDir.resolve("idns.yaml").toFile();
|
||||
Files.asCharSink(tldFile, UTF_8).write(loadFile(getClass(), "idns.yaml"));
|
||||
@@ -626,6 +646,8 @@ public class ConfigureTldCommandTest extends CommandTestCase<ConfigureTldCommand
|
||||
tld.asBuilder()
|
||||
.setIdnTables(ImmutableSet.of(JA, UNCONFUSABLE_LATIN, EXTENDED_LATIN))
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("zeta", "alpha", "gamma", "beta"))
|
||||
.setCreateBillingCostTransitions(
|
||||
ImmutableSortedMap.of(START_OF_TIME, Money.of(USD, 13)))
|
||||
.setBreakglassMode(true)
|
||||
.build());
|
||||
File tldFile = tmpDir.resolve("idns.yaml").toFile();
|
||||
@@ -645,6 +667,8 @@ public class ConfigureTldCommandTest extends CommandTestCase<ConfigureTldCommand
|
||||
tld.asBuilder()
|
||||
.setIdnTables(ImmutableSet.of(JA, UNCONFUSABLE_LATIN, EXTENDED_LATIN))
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("zeta", "alpha", "gamma", "beta"))
|
||||
.setCreateBillingCostTransitions(
|
||||
ImmutableSortedMap.of(START_OF_TIME, Money.of(USD, 13)))
|
||||
.setBreakglassMode(true)
|
||||
.build());
|
||||
File tldFile = tmpDir.resolve("idns.yaml").toFile();
|
||||
|
||||
Reference in New Issue
Block a user