diff --git a/core/src/main/java/google/registry/model/tld/Tld.java b/core/src/main/java/google/registry/model/tld/Tld.java index c18a28755..e85c6d930 100644 --- a/core/src/main/java/google/registry/model/tld/Tld.java +++ b/core/src/main/java/google/registry/model/tld/Tld.java @@ -138,7 +138,10 @@ public class Tld extends ImmutableObject implements Buildable, UnsafeSerializabl try { String thisYaml = mapper.writeValueAsString(this); String otherYaml = mapper.writeValueAsString(tldToCompare); - return thisYaml.equals(otherYaml); + // Since Jackson uses getters and not field values to construct the YAML representation, an + // explicit check of the createBillingCostTransitions is necessary since this field is + // auto-populated in the getter when the field is set to null. + return thisYaml.equals(otherYaml) && createBillingCostTransitionsEqual(tldToCompare); } catch (JsonProcessingException e) { throw new RuntimeException(e); } @@ -692,6 +695,15 @@ public class Tld extends ImmutableObject implements Buildable, UnsafeSerializabl .toValueMap(); } + public boolean createBillingCostTransitionsEqual(Tld newTld) { + if (createBillingCostTransitions == null) { + return false; + } + return createBillingCostTransitions + .toValueMap() + .equals(newTld.getCreateBillingCostTransitions()); + } + /** * Returns the add-on cost of a domain restore (the flat tld-wide fee charged in addition to one * year of renewal for that name). diff --git a/core/src/test/java/google/registry/tools/ConfigureTldCommandTest.java b/core/src/test/java/google/registry/tools/ConfigureTldCommandTest.java index ab5a2644e..58ab13c27 100644 --- a/core/src/test/java/google/registry/tools/ConfigureTldCommandTest.java +++ b/core/src/test/java/google/registry/tools/ConfigureTldCommandTest.java @@ -140,6 +140,8 @@ public class ConfigureTldCommandTest extends CommandTestCase